Removing elements in an array

1 次查看(过去 30 天)
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.

采纳的回答

Thomas
Thomas 2012-4-3
aaa(aaa~=0)
or
aaa(~~aaa)

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Matrix Indexing 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by