Files
School/Anul 3/Semestrul 2/Calcul numeric/Lab7.m
T
2025-07-03 20:56:38 +03:00

33 lines
453 B
Matlab

#truex = linspace(0,1,20);
#x0=[0,1/3,1/2,1]
#f=@(x)cos(pi*x);
#plot(x0, f(x0),'o');
#hold on
#plot(truex, f(truex),'blue');
#lnf = newton(x0,f(x0),truex)
#plot(truex, lnf, 'r');
#lnf = newton(x0,f(x0),1/5)
#truex = linspace(1001,1009,9);
#x0=[1000,1010,1020,1030,1040,1050];
#f0=[3.000000,3.0043214,3.0086002,3.0128372,3.0170333,3.0211893];
#lnf = newton(x0,f0,truex)
x0 = linspace(-4,4,9);
f=@(x)power(2,x);
lnf = aitken(x0,f(x0),1/2)