답변 있음
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

| 수락됨

더 보기