Help in finding the matrix

1 vue (au cours des 30 derniers jours)
Lev Mihailov
Lev Mihailov le 12 Sep 2019
Réponse apportée : J Chen le 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 commentaires
Lev Mihailov
Lev Mihailov le 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 le 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.

Connectez-vous pour commenter.

Réponses (1)

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

Catégories

En savoir plus sur Matrices and Arrays dans Help Center et File Exchange

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by