How can I remove zero values from the followning label matrix?.

조회 수: 2 (최근 30일)
moon sun
moon sun 2014년 9월 22일
댓글: moon sun 2014년 9월 22일
How can I remove zero values form the following
?.

채택된 답변

Hikaru
Hikaru 2014년 9월 22일
If your matrix is A, then
A(A==0) = []
will remove the zeros. But it will change the matrix into a vector.
If you want to keep the matrix in the same shape, maybe
A(A==0) = NaN
  댓글 수: 2
moon sun
moon sun 2014년 9월 22일
Thank you Hikaru
moon sun
moon sun 2014년 9월 22일
Than you so much, Hikaru, i got it by your code .

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Matrices and Arrays에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by