Removing elements in an array

2 visualizaciones (últimos 30 días)
Bathrinath
Bathrinath el 3 de Abr. de 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.

Respuesta aceptada

Thomas
Thomas el 3 de Abr. de 2012
aaa(aaa~=0)
or
aaa(~~aaa)

Más respuestas (0)

Categorías

Más información sobre Matrix Indexing en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by