Help in finding the matrix

12 ビュー (過去 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 Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

製品

Community Treasure Hunt

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

Start Hunting!

Translated by