For example, in the sample code for fsolve:
fun = @root2d;x0 = [0,0];x = fsolve(fun,x0)
where :
function F = root2d(x)current_iteration= ?F(1) = exp(-exp(-(x(1)+x(2)))) - x(2)*(1+x(1)^2);F(2) = x(1)*cos(x(2)) + x(2)*sin(x(1)) - 0.5;
In the code root2d, if my non linear problem formulation depends on the current iteration, how can i access the present iteration number?
I understand that once all the iterations have been completed, we can get the total number of iterations for convergence using 'output paramter' but this is not what i want.
Best Answer