Finding corresponding Y value in matrix with redundant data
Show older comments
I want to find corresponding Y value in matrix with redundant data.
Example:
x = [4 8 2 5 8 2] y = [1 2 3 3 4 5]
I want to get y value of 8. but i can't use indexing as in matlab for redundant data we get index as 1.
Answers (1)
Andrei Bobrov
on 5 Mar 2014
x = [4 8 2 5 8 2];
y = [1 2 3 3 4 5];
l0 = ~ismember(x,y);
out = unique(x(l0));
outidx = find(l0);
Categories
Find more on Matrix Indexing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!