Beantwortet
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 ...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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: ...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 1

Beantwortet
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...

etwa 13 Jahre vor | 0

Beantwortet
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...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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) ; ...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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:...

etwa 13 Jahre vor | 1

Beantwortet
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...

etwa 13 Jahre vor | 1

Beantwortet
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 ...

etwa 13 Jahre vor | 3

Beantwortet
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...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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 ...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 0

Beantwortet
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...

etwa 13 Jahre vor | 0

Beantwortet
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] ; ...

etwa 13 Jahre vor | 0

| akzeptiert

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

etwa 13 Jahre vor | 0

Beantwortet
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) ; ...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 1

Beantwortet
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 ...

etwa 13 Jahre vor | 6

Beantwortet
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...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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: ...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
[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 ...

etwa 13 Jahre vor | 0

Beantwortet
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...

etwa 13 Jahre vor | 0

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 1

| akzeptiert

Beantwortet
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...

etwa 13 Jahre vor | 0

Beantwortet
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...

etwa 13 Jahre vor | 2

| akzeptiert

Mehr laden