Matlab find() function in script

  • Context: MATLAB 
  • Thread starter Thread starter phyhari
  • Start date Start date
  • Tags Tags
    Function Matlab
Join the discussion
Registration is free. Ask a follow-up in this thread, or start your own.
2 replies · 10K views
phyhari
Messages
2
Reaction score
0
SOLVED.
Hi All!
Brief version:
I would like to use statement starting with [ in Matlab script. Is it possible, if yes, how?

Longer version:
I'm writing code in matlab. I need to find matrix indices, for which the statement M==10 is true. (I found find() function, which is perfect for the task).

[r,c]=find[M==10];

It works perfectly within the command window, but not in my script.
I get an error message, stating: parse error at '[' ... not valid MATLAB script
Can you help, or I must write an algorithm for finding indices? :S

Thanks in advance!
 
Last edited:
Physics news on Phys.org
Thank you! :) That was the problem. As you can see I'm just started coding in matlab...