How to change non zero value into 0?
1 回表示 (過去 30 日間)
古いコメントを表示
I want to manipulate n*n matrix such the first 10 non-zeros value in every column of matrix and change them into zero.Matrix is in the form of binary[0,1].
1 件のコメント
madhan ravi
2019 年 8 月 21 日
It's similar as your previous question:
B = cumsum(A, 1);
out = A .* (B > m)
And change the answer in John D' Errico's answer part 'last' to 'first'.
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Matrix Indexing についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!