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