Removing elements in an array

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일

0 개 추천

aaa(aaa~=0)
or
aaa(~~aaa)

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2012년 4월 3일

Community Treasure Hunt

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

Start Hunting!

Translated by