Removing elements in an array

조회 수: 8 (최근 30일)
Bathrinath
Bathrinath 2012년 4월 3일
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