storing indices of some entries in a matrix

조회 수: 2 (최근 30일)
R yan
R yan 2014년 4월 20일
편집: Mischa Kim 2014년 4월 20일
I want to store the index of all the entries with value 5 in a matrix. is there an inbuilt function for it.

답변 (1개)

Mischa Kim
Mischa Kim 2014년 4월 20일
편집: Mischa Kim 2014년 4월 20일
Ryan, use
[r c] = find(data==5)
r and c are the row and column indices of all data entries equal to 5.

카테고리

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

Community Treasure Hunt

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

Start Hunting!

Translated by