Reputation: 225
For example,
for i = 1:10
x = i + 2
s(1:i) = (x > 4);
result s = [0 0 0 1 1 1 1 1 1 1]'
how to located the column and row of the first "1" appeared in s?
Look for a script.
Thanks!!
Upvotes: 0
Views: 78
Reputation: 78364
For a vector like s
it's easy
find(s==1,1)
should do what you want.
Upvotes: 1