[Matlab] - Getting Index

sak

New Member
#1
I have an giant array (30000 x 9) and I want to know the exact location of a certain number. Is there anything like find function in matlab to do this without looping?
 
#2
Say you have a matrix A and you want to find every position with a one. You can do this by:

B = (A == 1 ),

where B will be a logical with 1's at the positions which are 'true'.

If you want the positions of these you can use the function find() around this:

C = find(B) ;