a = [1;1;1;2;3;3;4;5;6;7];b = [1;1;1;1;1;2;3;4;4;4;5;6;7;7];% I should get the following logical index as answer. Find position in b with equivalent in a.
idx = [1;1;1;0;0;1;1;1;0;0;1;1;1;0];
I tried intersect and ismember but cant seem to find an elegant way without looping. Thanks in advance!
Best Answer