Sum up dissimilar values in a matrix
1 回表示 (過去 30 日間)
古いコメントを表示
Hi All,
I have a 12*12 matrix and want to add the entries of matrix which are not equal to 1 and which are not similar to any other value in the Matrix. In short, I want to add up all the dissimilar values and the values not equal to 1.
Is there any short way to do so using loop function.
Many Thanks
Anum
0 件のコメント
採用された回答
the cyclist
2019 年 11 月 15 日
編集済み: the cyclist
2019 年 11 月 15 日
If M is your array ...
sum(unique(M(M~=1)))
3 件のコメント
その他の回答 (0 件)
参考
カテゴリ
Help Center および 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!