Find indices of column/row in double that have matching value

조회 수: 15 (최근 30일)
DavidL88
DavidL88 2021년 5월 5일
댓글: DavidL88 2021년 5월 5일
a = 5.786
b = 14x308 double (all cells contain numerical values)
Assuming there is one cell in 'b' with a value that matches 'a' exactly - how do I found the column/row indices in b of this matching cell?

채택된 답변

the cyclist
the cyclist 2021년 5월 5일
편집: the cyclist 2021년 5월 5일
Sounds like you could use either the find or ismember command.
  댓글 수: 1
DavidL88
DavidL88 2021년 5월 5일
Thanks that worked! I had tried using find with ismember or intersect but hadn't worked. Just used [c latency] = find(a == b); and that worked.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Logical에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by