Professional Documents
Culture Documents
%Update iteration
i = i + 1;
xolder = xold;
f_xolder = f_xold;
xold = xnew;
f_xold = f_a2q1(xold); %get function value at xold
end
if i<n
'Root is'
xold
'Iterations are'
i
else
'No convergence'
end
% --------------------------------------
%Function f_a2q1(x)
F = x.^2 - 5248;
f = 2*x;
end
% --------------------------------------