while abs(dE) > 1e-12iteration=iteration+1;E_old = E;E = M+(ecc(1)*sin(E)); %eccentric anomaly
dE=E-E_old;if iteration==1000warndlg('iteration cannot be converged ', 'Error!', 'modal')endend
How can I modify above code to terminate the while loop when iteration exceeds 1000?
Best Answer