How i can remove inf value and zero value in 10x10 Matrix?

Hi, I want to remove the highlight red data from the 10x10 matrix and also the index (i=j) which is inf.? Need your guidance. One more thing I want to extract the indices where the value is non zero?

 採用された回答

goerk
goerk 2016 年 1 月 25 日
編集済み: goerk 2016 年 1 月 25 日

0 投票

I assume you want the finite values which are not zero?
A % input Matrix
nonZeroValues = A(A~=0 & isfinite(A));
to get the indices you can run
ind = find(A~=0 & isfinite(A))
[row col] = ind2sub(size(A), ind)

1 件のコメント

Arsal15
Arsal15 2016 年 1 月 25 日
編集済み: Arsal15 2016 年 1 月 25 日
Thanks goerk :)

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

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

質問済み:

2016 年 1 月 25 日

編集済み:

2016 年 1 月 25 日

Community Treasure Hunt

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

Start Hunting!

Translated by