I'm wondering when my while loop expression is satisfied. Err is a [1x1551] complex double
. Is my loop stopping when one value satisfies the expression (abs(real(err))>1e-4)
? or when all values in the array satisfies the expression. The function is converting towards a constant with increasing p
dt=0.01;
t=0:dt:T;
err=1;
p=-1;
dphi_sum=0;
while abs(real(err))>1e-4
p=p+1
dphi_sum2 = function(p);
err = (dphi_sum+dphi_sum2)./(dphi_sum)-1;
dphi_sum = dphi_sum+dphi_sum2;
end