Answered
Cell array as input for loop
_"problem here is I don't know how to loop [over] the length of the array"_ Hint: cac = {'a','b','c'}; % loop...

11 years ago | 0

Answered
How to replace vector values without loop for?
Hint: x( y(:,1)>=z(:,1), 1 ) = 1; However, I didn't say that this is faster than the loop

11 years ago | 0

Answered
Subscripted assignment dimension mismatch.
Hint: >> m = zeros(1,3); >> m(1,:) = cssm; Subscripted assignment dimension mismatch. where function...

11 years ago | 0

Answered
Why is sort() taking longer to resolve on multiples of 512?
I have reproduced your result with R2013a,64bit,Win7,8GB on a five year old vanilla desktop (Processor Intel(R) Core(TM)2 Quad C...

11 years ago | 0

Answered
Why cant I create a function in MatLab student version?
Because |function sum = myfirst(v,w)| must be the first executable line of the m-file. Read <http://www.mathworks.se/help/matla...

11 years ago | 0

Answered
Save 'v7.3' apparently uses no compression - how to turn it on?
Testing compression with |ones(15e3)| gives unrealistic results. Instead test with random numbers %% m = rand(15...

11 years ago | 0

Answered
Getting user input until they select the right choice
Start simple. Hint: x = inf; y = inf; while is_outside(x,y) disp('select a point') [x,y] = gi...

11 years ago | 0

Answered
where is the mistake in this code?
Don't write longer lines than you can handle. Introduce temporary variables like meaningful_name = (2*(D*t)^0.5); tha...

11 years ago | 0

Answered
separating non empty array
_"what i'm trying to do now is to split this 1764 x 1 into 884 x 2 double"_ This does it long_vector = linspace( 1, 12...

11 years ago | 1

Answered
minimum value array issue
Another approach, try dn = [2 5 8 7 0 1]; [ dn_sorted, ix ] = sort( dn, 'ascend' ); |ix| contains the "positions"...

11 years ago | 0

Answered
finding the max values and their coordinates/indices
I believe that |max| behaves as intended and that the documentation doesn't describe the function properly. Try >> m ...

11 years ago | 0

Answered
help in p code
The old Matlab way is to accompany the file |my_function.p| with a file |my_function.m|, which only contains the help-text. ...

11 years ago | 0

| accepted

Answered
Bizarre value class behavior
_"I followed proper VALUE class syntax for setX and setY."_ &nbsp No, that's handle class syntax. With a value class you create ...

11 years ago | 0

| accepted

Answered
How to convert multiple date formats in a loop?
And a third alternative assuming the data is in a textfile >> [ sdn, val ] = read_multiple_date(); >> whos sdn val ...

11 years ago | 1

Answered
maximum variable size allowed by the program is exceeded?
|ones(1:n)| tries to create a n-dimensional monster. Try >> ones(1:3) ans(:,:,1) = 1 1 ans(:,:,2)...

11 years ago | 0

| accepted

Answered
Undefined function 'F' for input arguments of type 'char'.
_"'s' is just a dummy variable, so why do I need to define it?"_ &nbsp If you try to define a function, |F|, see <www.mathwo...

11 years ago | 0

Answered
Can't quit Matlab program
Doc says quit terminates MATLAB after running the script FINISH.M, if it exists. Could it be that you have a file nam...

11 years ago | 0

Answered
max function is missing in the @logical file on 'matlab' toolbox
Firstly try which max -all which shows that there are |max| for many types of data, but not for |struct|. Secondly...

11 years ago | 0

Answered
Handling user-defined matlab class returned from Java collection
Are you aware of the <http://undocumentedmatlab.com/ Matlab-Java book>? That or the blog <http://undocumentedmatlab.com/ Undocum...

11 years ago | 0

Answered
Undefined function 'F' for input arguments of type 'char'.
Replace the string Untitled by F and replace F := int((42 .... by F = int((42 .... ...

11 years ago | 0

Answered
use of greater than and less than
The MATLAB syntax is if 0<L && L<5, rad=L+10 else rad=L+2 end or 0<L & L<5 ...

11 years ago | 2

Answered
how to rename or move files
_"from one name to another in the same folder."_ &nbsp I cannot see that you provide _"another name"_ movefile (['dt_ref_me...

11 years ago | 0

Answered
sprintf('%d',x) prints out exponential notation instead of decimal notation
What you see is a consequence of how *floating point arithmetic* works. See: * <http://matlab.wikia.com/wiki/FAQ#Why_is_...

11 years ago | 1

| accepted

Answered
Why does not overloading using assignin work?
There is a function why to explain behaviors like this one. I use it when |help| doesn't help. I added |whos| befo...

11 years ago | 1

Answered
read a variable from .txt file
See * <http://www.mathworks.se/help/matlab/file-opening-loading-and-saving.html Import and Export Basics, Functions that imp...

11 years ago | 0

| accepted

Answered
How to read Ms word file in matlab?
I assume you have Ms Word installed. If so * Search the File Exchange for <http://www.mathworks.com/matlabcentral/fileexchang...

11 years ago | 3

Answered
how to find the equation that best fit this curve
See *SLM* Description: If you could only download one curve fitting tool to your laptop on a desert island, this should be ...

11 years ago | 0

| accepted

Answered
Clever solution sought: Summing values from an array into a vector component given in a second array
Yes, |accumarray| beats the loop for large arrays (R2013a) %% M = 2e3; K = 5e3; ix = randi(M,[K,M]); ...

11 years ago | 0

Answered
Test the variable type from file input
Another approach %% fid = fopen('bananas.txt','r'); cac = textscan( fid, '%s%s%s%s%s' ); fclose( fid ) ...

11 years ago | 0

| accepted

Load more