I have a problem that seems to be simple but maybe I am missing something. Let us say I have: vector = [10:1:19];
. I have another vector, want = [11 16 19];
I simply want a way in which a command will return for me, the indicies at which 11, 16, and 19 occur in vector. In other words, I want to have returned, 2, 7, and 10. What command might do this? I cannot use find
, (because dimensions do not match), so is there another way?
In reality the length of vector
and want
will be long, so a for loop will not do. Thank you.