Function similar to isnan for zeros

118 vues (au cours des 30 derniers jours)
Raldi
Raldi le 26 Fév 2015
Commenté : Matt J le 26 Fév 2015
Is there a function that does what isnan does but with zeros?

Réponse acceptée

Matt J
Matt J le 26 Fév 2015
Modifié(e) : Matt J le 26 Fév 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 commentaire
Matt J
Matt J le 26 Fév 2015
Or the not() command
>> nonzeroMap=not(A)
nonzeroMap =
0 1 0 0 1 1 0

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Data Type Identification dans Help Center et File Exchange

Tags

Produits

Community Treasure Hunt

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

Start Hunting!

Translated by