I can find the position of the value, i.e. 45, in vector data, using the operator == and the find () function:
data = [ 71 65 23 45 34 12 21 34 52 ]; value = 45; find (data == value) ans = 4
Is there a way to do the same for multiple values without using a loop, that is, I would like to get [4 5 7] in one call:
values = [ 45 34 21 ]; find (data == values) error: mx_el_eq: nonconformant arguments (op1 is 1x9, op2 is 1x3) error: evaluating argument list element number 1 error: evaluating argument list element number 1
operators vectorization find matlab octave
rmv
source share