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 日

0 投票

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 日

0 投票

Thank you for fast answer. Its wonderful.

カテゴリ

ヘルプ センター および File Exchange で Resizing and Reshaping Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by