回答済み
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 ...

13年弱 前 | 1

| 採用済み

回答済み
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: ...

13年弱 前 | 0

| 採用済み

回答済み
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...

13年弱 前 | 1

回答済み
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...

13年弱 前 | 0

回答済み
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...

13年弱 前 | 1

| 採用済み

回答済み
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) ; ...

13年弱 前 | 0

| 採用済み

回答済み
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...

13年弱 前 | 1

| 採用済み

回答済み
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...

13年弱 前 | 0

| 採用済み

回答済み
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...

13年弱 前 | 1

| 採用済み

回答済み
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:...

13年弱 前 | 1

回答済み
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...

13年弱 前 | 1

回答済み
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 ...

13年弱 前 | 3

回答済み
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...

13年弱 前 | 0

| 採用済み

回答済み
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...

13年弱 前 | 1

| 採用済み

回答済み
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 ...

13年弱 前 | 0

| 採用済み

回答済み
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...

13年弱 前 | 0

| 採用済み

回答済み
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...

13年弱 前 | 0

回答済み
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...

13年弱 前 | 0

回答済み
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] ; ...

13年弱 前 | 0

| 採用済み

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

13年弱 前 | 0

回答済み
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) ; ...

13年弱 前 | 1

| 採用済み

回答済み
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...

13年弱 前 | 1

回答済み
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 ...

13年弱 前 | 6

回答済み
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年弱 前 | 1

| 採用済み

回答済み
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年弱 前 | 1

| 採用済み

回答済み
[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年弱 前 | 0

回答済み
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年弱 前 | 0

| 採用済み

回答済み
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年弱 前 | 1

| 採用済み

回答済み
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年 前 | 0

回答済み
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年 前 | 2

| 採用済み

さらに読み込む