Matlab find() function in script


by phyhari
Tags: '[', error, find(), matlab, script
phyhari
phyhari is offline
#1
Sep20-10, 05:29 PM
P: 2
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!
Phys.Org News Partner Science news on Phys.org
Going nuts? Turkey looks to pistachios to heat new eco-city
Space-tested fluid flow concept advances infectious disease diagnoses
SpaceX launches supplies to space station (Update)
Pythagorean
Pythagorean is offline
#2
Sep21-10, 05:47 AM
PF Gold
Pythagorean's Avatar
P: 4,182
Use (), not [] for the find argument
phyhari
phyhari is offline
#3
Sep21-10, 08:29 AM
P: 2
Thank you! :) That was the problem. As you can see I'm just started coding in matlab...


Register to reply

Related Discussions
math with action script (Joukowski's + action script = HOW!!?!?!?) Programming & Computer Science 1
MATLAB find function 4D array Programming & Computer Science 3
Matlab- Second moment of Area(I) Script Help! Programming & Computer Science 2
Does a function exist (prefferably in matlab) that finds a function in noise Math & Science Software 4
How do I find the Critical points of a multi-variable function using MATlab? Math & Science Software 3