How to change non zero value into 0?

조회 수: 1 (최근 30일)
vikash kumar
vikash kumar 2019년 8월 21일
댓글: madhan ravi 2019년 8월 21일
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
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 CenterFile Exchange에서 Matrix Indexing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by