I have an array A in which I delete rows based n a certain condition within another corresponding matrix which consists of the mean values of A. Each time I delete a row, I want my 'i' counter to jump back 1 iteration in order to not skip rows.
Means_Array=mean(A,2);for i = 1:size(A,1) if Means_Array(i,1)==0 Means_Array(i,:)=[]; A(i,:)=[]; i=i-1 endend
This does however not work for some reason and the 'i' resets back to the value it would have taken if the i=i-1 was not even there.
Best Answer