Register to reply

Matlab find() function in script

by phyhari
Tags: '[', error, find(), matlab, script
Share this thread:
phyhari
#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
'Office life' of bacteria may be their weak spot
Lunar explorers will walk at higher speeds than thought
Philips introduces BlueTouch, PulseRelief control for pain relief
Pythagorean
#2
Sep21-10, 05:47 AM
PF Gold
Pythagorean's Avatar
P: 4,292
Use (), not [] for the find argument
phyhari
#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