Help in finding the matrix

1 Ansicht (letzte 30 Tage)
Lev Mihailov
Lev Mihailov am 12 Sep. 2019
Beantwortet: J Chen am 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 Kommentare
Lev Mihailov
Lev Mihailov am 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 am 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.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

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

Kategorien

Mehr zu Matrices and Arrays finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by