storing indices of some entries in a matrix

1 回表示 (過去 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 Center および File ExchangeData Types についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by