Answered
How do I detect volume collisions?
*EDITED @ 2:53PM : wrote function for 2D and 3D cases.* *EDITED @ 2:34PM : simplified computation of |A|.* Ok, you picked ...

12 years ago | 1

| accepted

Answered
Read text file line by line, and then store the information into a struct
I would go for a solution close to what you implemented, but splitting the file content first into blocks of data. For example: ...

12 years ago | 0

| accepted

Answered
How long have you been using matlab? tell us your story
I started using MATLAB in 95, but I didn’t get serious about it until 97. Being more of a "low level" programming and electronic...

12 years ago | 1

Answered
Iterating a function within a for loop
You can debug it e.g. by rewriting result(i)=VTL(chord,alpha(i),alpha_ol,b,Sref,lambda,et,npan1,npan2,A,B,A1,B1) as t...

12 years ago | 0

Answered
How can I create a matrix based on a double vector lookup?
You probably want something like: [un_a,~,ic_a] = unique(a) ; [un_b,~,ic_b] = unique(b) ; result = zeros(length(un_a), l...

12 years ago | 1

| accepted

Answered
Moving through varibles in for loop (ugly)...
If it is enough to check one variable only and update them all accordingly, one solution could be: dup = ~diff(RMSVal) ; ...

12 years ago | 0

| accepted

Answered
Row/Column Deletion Formatting
When you index |A| using one sub, you perform what is called a linear indexing (see e.g. IND2SUB or SUB2IND). When you do so, th...

12 years ago | 1

| accepted

Answered
Arrayfun scalar expansion (non-uniform output)
I might not fully understand your question, but why don't you do something like: output = arrayfun( ... @(m1,m2) myFunc...

12 years ago | 0

| accepted

Answered
Slow Triple for loop
The very first thing is that you should not modify the loop index |LatCounter| within the loop. ( *EDIT:* the following sentence...

12 years ago | 1

| accepted

Answered
How do I find and replace all instances of a substring in a structure?
If what you call a structure is the content of a char array (and not a struct object), you can use STRREP or REGEXPREP. Example:...

12 years ago | 1

Answered
Getting rows that correspond to second occurrence of a value
Here is another one liner: >> regexp('','(?@ buffer=urlread(''http://en.wikipedia.org/wiki/Sea_urchin''); eval(''x(strf...

12 years ago | 1

Answered
Is it me ? or something else ...
I think that _"solved easily using Google"_ is somewhat an arbitrary statement/judgement, in the sense that there are certainly ...

12 years ago | 3

Answered
What would be the best approach to solve this data mapping problem?
It is not trivial in the sense that REGEXP provides you with two series of data with no information for relating one to the othe...

12 years ago | 0

| accepted

Answered
fprintf 13 values in a 5x4 matrix without zeros.
The following might help (not tested): nCol = 4 ; Dt = D.' ; nDt = numel(Dt) ; for ii = 1 : nDt if Dt(ii) ~= 0...

12 years ago | 1

| accepted

Answered
Find locations of repeated values?
I think that you can use two approaches. I'll illustrate with a simple example: say we have the following data >> data = [7 ...

12 years ago | 0

| accepted

Answered
subsetting a three dimensional array from elements in a vector
It is actually very good for a first attempt! You might want to do something like the following actually: b = 1:34:400 ; n...

12 years ago | 0

| accepted

Answered
Problems reading a text file: saving text file with no changes solves problem.
The text editor might replace tabs with spaces actually, or |\r| or |\n| with |\r\n|, or weird characters with spaces. Did you t...

12 years ago | 0

Answered
How mat lab Helpful to mapinfo software And Arcgis softwares?
Look for the Mapping Toolbox manual here: <http://www.mathworks.com/help/pdf_doc/allpdf.html> The toolbox will allow you to r...

12 years ago | 0

Answered
re-running a for loop for 100s of different ranges
You should work on a much simpler code to understand how it works. Here is an example.. ranges = [3, 8; 2, 5; 1,7] ; ...

12 years ago | 0

| accepted

Answered
help with managing data
Using the command WHOS in your command window, you get >> whos Name Size Bytes Class Attributes ...

12 years ago | 0

Answered
How to read text file which has blanks in some columns ?
There are quite a few approaches. Here one example: fh = fopen('Swati.txt', 'r') ; fgetl(fh) ; ...

12 years ago | 1

| accepted

Answered
search and delete text lines when certain strings are missing
If there cannot be any |N| or |E| other than those for Northings and Eastings, you can proceed as follows: fh = fopen('myDat...

12 years ago | 1

Answered
Create a structure name based on the string of a variable. Create fieldnames in this structure.
Why do you want to do this? In my experience, cases where it is appropriate to define dynamically variables names are extremely ...

12 years ago | 6

Answered
Parsing string into cell array "bash-script style"
Your solution is not working on my system; |"there you"| is split in |"there| and |you"| (essentially because the |\S+| expressi...

13 years ago | 1

| accepted

Answered
extract a variable from middle of a line of a .dat file with mixed text and numbers
If LAT/LONG can really be anywhere in the file (not on 2nd line as shown in your sample), you could go for a regexp solution: ...

13 years ago | 1

| accepted

Answered
[DISCONTINUED] MATLAB Answers Wish-list #2 (and bug reports)
I think that it would be very interesting to have the possibility to tag/flag/mark/attach/bookmark threads so we can keep track ...

13 years ago | 0

Answered
How can I create a sparse matrix containing (3,3) block matrices on the main diagonal and on diagonals below and above the main diagonal without using loops?
BLKDIAG will give you a sparse matrix if one of its inputs is sparse. Try building the 3x3 matrices as sparse, or converting the...

13 years ago | 0

| accepted

Answered
How can I output specific point of data to a sparse matrix.
It is much more efficient to build the matrix directly with "i", "j" as indices of non zeros elements and a vector of values (or...

13 years ago | 1

| accepted

Answered
Group numbers from excel column based on character
Here is a developed example: >> data = [1 2 3 4 -2 -3 4 6 6 -3 -6 -5 -7 2 1 5] ; We try to develop a solution that detect...

13 years ago | 0

Answered
How to read strings from file with fscanf or sscanf (NOT textscan)?
Just a few alternate thoughts (and I'll think about FSCANF over the week end a little more). *=== Using REGEXP* (available in...

13 years ago | 2

| accepted

Load more