MATLAB Answers

Help in finding the matrix

2 views (last 30 days)
Lev Mihailov
Lev Mihailov on 12 Sep 2019
Answered: J Chen on 12 Sep 2019
Hello! I have a vector of values, and I need to find their location in the matrix
% 1000x100 matrix
% 1x100 data

  6 Comments

Show 3 older comments
Andrei Bobrov
Andrei Bobrov on 12 Sep 2019
In this case, what result do you expect?
Lev Mihailov
Lev Mihailov on 12 Sep 2019
Z=ismember(Y,X);
When used along the entire length of the file, it produces a logical and all values ​​= 1
Adam Danz
Adam Danz on 12 Sep 2019
That's because all element of Y are indeed in X. Try it the other way around. X as the first input.

Sign in to comment.

Answers (1)

J Chen
J Chen on 12 Sep 2019
You can use [row,col]=find( ) to get the location and use == to compare numbers

  0 Comments

Sign in to comment.

Sign in to answer this question.