Function similar to isnan for zeros

조회 수: 117 (최근 30일)
Raldi
Raldi 2015년 2월 26일
댓글: Matt J 2015년 2월 26일
Is there a function that does what isnan does but with zeros?

채택된 답변

Matt J
Matt J 2015년 2월 26일
편집: Matt J 2015년 2월 26일
The ~ operator
>> A=[1 0 2 3 0 0 4]
A =
1 0 2 3 0 0 4
>> nonzeroMap=~A
nonzeroMap =
0 1 0 0 1 1 0
  댓글 수: 1
Matt J
Matt J 2015년 2월 26일
Or the not() command
>> nonzeroMap=not(A)
nonzeroMap =
0 1 0 0 1 1 0

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

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Type Identification에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by