pick column and row of an entry

조회 수: 2 (최근 30일)
Tomas
Tomas 2013년 3월 4일
Hi, i would like to know is there any function which allow me to pick matrix entries greater than 10 and print those entries rows and columns in cells or in 2 separate matrices?

채택된 답변

Wayne King
Wayne King 2013년 3월 4일
편집: Wayne King 2013년 3월 4일
X = randi(20,10);
[I,J] = ind2sub(size(X),find(X>10));
The I vector has the row indices, the J vector has the column indices. You can certainly store those indices however you like.

추가 답변 (1개)

Tomas
Tomas 2013년 3월 4일
Thank you for fast answer. Its wonderful.

카테고리

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