To find the index of an element in a vector which is same as a given value, you can use the find
function in MATLAB.
Here's an example code block:
main.m221 chars9 lines
In the above example, find
returns the indices of the elements in myVector
which are equal to the given value. If no element is found, then an empty array is returned.
gistlibby LogSnag