Réponse apportée
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 ...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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: ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 1

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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) ; ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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:...

plus de 12 ans il y a | 1

Réponse apportée
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...

plus de 12 ans il y a | 1

Réponse apportée
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 ...

plus de 12 ans il y a | 3

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 1

| A accepté

Réponse apportée
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 ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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...

plus de 12 ans il y a | 0

Réponse apportée
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] ; ...

plus de 12 ans il y a | 0

| A accepté

Réponse apportée
help with managing data
Using the command WHOS in your command window, you get >> whos Name Size Bytes Class Attributes ...

presque 13 ans il y a | 0

Réponse apportée
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) ; ...

presque 13 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 13 ans il y a | 1

Réponse apportée
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 ...

presque 13 ans il y a | 6

Réponse apportée
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...

presque 13 ans il y a | 1

| A accepté

Réponse apportée
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: ...

presque 13 ans il y a | 1

| A accepté

Réponse apportée
[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 ...

presque 13 ans il y a | 0

Réponse apportée
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...

presque 13 ans il y a | 0

| A accepté

Réponse apportée
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...

presque 13 ans il y a | 1

| A accepté

Réponse apportée
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...

presque 13 ans il y a | 0

Réponse apportée
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...

presque 13 ans il y a | 2

| A accepté

Charger plus