I am triying to write a code which automatically checks the input data with a bounded range and removes the ones outside this boundary. I have written the following code:
LANDA_E_4=landa;
for i=1:m
if i>m
break
elseif LANDA_T_2(i)<0.2021e+03 || LANDA_T_2(i)>1.3317e+03
LANDA_T_2(i)=[];
i=i-1;
end
The problem here is that the "i" does not update within the loop. Consider the first element is not within the range, so it gets removed. now the loop should check the new first element which is the previous second element (before removing the first one) but the "i" whitin the loop is still 2. I can't update "i".
Thank you in advance