How to change non zero value into 0?

1 Ansicht (letzte 30 Tage)
vikash kumar
vikash kumar am 21 Aug. 2019
Kommentiert: madhan ravi am 21 Aug. 2019
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 Kommentar
madhan ravi
madhan ravi am 21 Aug. 2019
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'.

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Kategorien

Mehr zu Matrix Indexing finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by