MATLAB: How to search for specific numbers and their location in a matrix.

couple valuesgraphlocationlocation in matriceslocation in matrixlocation searchmatricesmatrixsearchsearch matrices

I would like to know if there is a way to search a matrix for a specific number (or a span of numbers) and to receive the location of that number (or numbers) in the matrix.
This would be useful when for example making a graph: to couple a specific number in the x-matrix to the corresponding y-value at the same location in the y-matrix. At the moment I have to search the matrix manually to be able to call for the right y-value.
Thanks for the help.

Best Answer

You can use find function,for example
A=[-2 1 4 8 9 20]
[ii,jj]=find(A>4)