Hello,
I have a matrix 50*50 and every single elements has a value of either '0' or '1' . How can I determine all locations of all non zero elements. It would be nice if I could store the location in an array or something easy to read and understand.
Thank you

 採用された回答

KALYAN ACHARJYA
KALYAN ACHARJYA 2020 年 4 月 3 日

0 投票

[r,c]=find(mat~=0)

1 件のコメント

Mo H
Mo H 2020 年 4 月 3 日
you are awesome

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

質問済み:

2020 年 4 月 3 日

コメント済み:

2020 年 4 月 3 日

Community Treasure Hunt

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

Start Hunting!

Translated by