Function similar to isnan for zeros

108 visualizaciones (últimos 30 días)
Raldi
Raldi el 26 de Feb. de 2015
Comentada: Matt J el 26 de Feb. de 2015
Is there a function that does what isnan does but with zeros?

Respuesta aceptada

Matt J
Matt J el 26 de Feb. de 2015
Editada: Matt J el 26 de Feb. de 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 comentario
Matt J
Matt J el 26 de Feb. de 2015
Or the not() command
>> nonzeroMap=not(A)
nonzeroMap =
0 1 0 0 1 1 0

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Data Type Identification en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by