Help in finding the matrix

1 次查看(过去 30 天)
Lev Mihailov
Lev Mihailov 2019-9-12
回答: J Chen 2019-9-12
Hello! I have a vector of values, and I need to find their location in the matrix
% 1000x100 matrix
% 1x100 data
  6 个评论
Lev Mihailov
Lev Mihailov 2019-9-12
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 2019-9-12
That's because all element of Y are indeed in X. Try it the other way around. X as the first input.

请先登录,再进行评论。

回答(1 个)

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

类别

Help CenterFile Exchange 中查找有关 Matrices and Arrays 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by