Removing elements in an array

8 vues (au cours des 30 derniers jours)
Bathrinath
Bathrinath le 3 Avr 2012
Hi,
I want to remove the elements which has zero values.
aaa = [ 0 0 2 3 0 6 ]
I need aaa = [ 2 3 6 ]
Suggest me to get this answer.

Réponse acceptée

Thomas
Thomas le 3 Avr 2012
aaa(aaa~=0)
or
aaa(~~aaa)
  1 commentaire
Bathrinath
Bathrinath le 3 Avr 2012
Thanks

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Matrix Indexing dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by