Function similar to isnan for 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

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 Constants and Test Matrices dans Centre d'aide et File Exchange

Produits

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by