Function similar to isnan for zeros

120 Ansichten (letzte 30 Tage)
Raldi
Raldi am 26 Feb. 2015
Kommentiert: Matt J am 26 Feb. 2015
Is there a function that does what isnan does but with zeros?

Akzeptierte Antwort

Matt J
Matt J am 26 Feb. 2015
Bearbeitet: Matt J am 26 Feb. 2015
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 Kommentar
Matt J
Matt J am 26 Feb. 2015
Or the not() command
>> nonzeroMap=not(A)
nonzeroMap =
0 1 0 0 1 1 0

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Numeric Types finden Sie in Help Center und File Exchange

Tags

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by