Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

delta = 0.

001;
x = -4;
k = 0;
fprintf('iter\t
[xk]\t [Fk]\t
normf\n');
f=2*x/3-sin(x);
df=2/3-cos(x);
normf=abs(f);
while normf>delta
k=k+1;
x=x+mldivide(f,df);
fprintf('%d\t
%.4f\t %.4f\n',k, x, normf);
end

You might also like