MATLAB: Removing elements in an array 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. Best Answer aaa(aaa~=0)oraaa(~~aaa) Related SolutionsMATLAB: Removing elements from an Array A = [0, 1]; B = [0, 1, 3, 1, 4, 5, 6]; C{1} = B(1:3) ; C{2} = B(4:end) ; for i = 1:2 C{i}(C{i}==A(i))=[] ; end cell2mat(C) MATLAB: Removing elements in an array A=[1 2 3 4]B=[5 10 15 20]c=[10 20] %numbers to remove from Bidx=ismember(B,[10 20])A(idx)=[] Related QuestionIndex exceeds the number of array elements (210)Resizing an array – removing elementsRemoving the array elements
Best Answer