III.1 Soal
interpretasikan
c)cos x=
x=[0:0.01:20]
III.2 SOLUSI
function r=solNR(f,df,x0,maks,epsl)
iter=1;
galat=epsl+1;
d=df(x0);
if abs (d)<1e-12
error('Proses Gagal');
end
xbaru=x0-f(x0)/d;
galat=abs(xbaru-x0);
x0=xbaru;
iter=iter+1;
end
else
r = xbaru;
end
III.2.2 Output
Soal a)
Soal b)galat=1e-2
Gaalat= 1e-5
Galat=1e-10
soal c)
Galat =1e-5
Tebakan awal x0=0
Galat=1e-15
Galat-1e-20