Finding corresponding Y value in matrix with redundant data

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.

답변 (1개)

Andrei Bobrov
Andrei Bobrov 2014년 3월 5일
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);

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2014년 3월 5일

답변:

2014년 3월 5일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by