i want to delete the zeros without using nonzeros
x=[1 2 2 0 3 1 3 0 0];i=1;j=1;while i <= length(x) if x(i)==0 x(i) =[] ; else x(i)=x(i);endwhile j <= length(x) if x(j)==0 x(j) =[] ; else x(j)=x(j);endj=j+1;i=i+1;end endx
Best Answer