finding position in matrix

2 ビュー (過去 30 日間)
sarp karayegen
sarp karayegen 2020 年 4 月 20 日
回答済み: Jyotsna Talluri 2020 年 4 月 23 日
I couldnt find the way to figure out how find position M(m,n) matrix can you help me ?
  2 件のコメント
Michael Soskind
Michael Soskind 2020 年 4 月 20 日
If you want to find a list of positions, you can use:
find(condition)
Where condition might look like M == 1
Alternatively, you could simply use
M == 1
Which would return a logical array of size n x m, meaning that calling M(M==1) would give you a list of the values at the indices above.
Ameer Hamza
Ameer Hamza 2020 年 4 月 20 日
sarp, can you further elaborate your question with an example of what you mean by "find position M(m,n)"?

サインインしてコメントする。

回答 (1 件)

Jyotsna Talluri
Jyotsna Talluri 2020 年 4 月 23 日
[row,column] = find(M ==element);

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by