Professional Documents
Culture Documents
Tugas Metode Numerik
Tugas Metode Numerik
3x + 2y + z = 12
2x + 7y + 2z = 28
8x + 2y – 7z = 4
Dengan program MATLAB tentukan gambar serta persamaan hasil interpolasi polinomial dari 6 titik
berikut:
Jawab:
y = ax 5 + bx 4 + cx 3 + dx 2 + ex + f
0 0 0 0 0 1 b -10
>> clc
>> A=[20.^5 20.^4 20.^3 20.^2 20 1; 0 0 0 0 0 1; 30.^5 30.^4 30.^3 30.^2 30 1; 10.^5 10.^4 10.^3
10.^2 10 1; 55.^5 55.^4 55.^3 55.^2 55 1; (-20).^5 (-20).^4 (-20).^3 (-20).^2 (-20) 1] //Adalah
bentuk matrik dari persamaan tersebut
>> T=A\B
>> X = [-1000:0.1:1000];
>> Y = (-0.0026).*X.*3+0.0804.*X.^2+0.1616.*X-10;
>> plot(X,Y)
A=
Columns 1 through 5
0 0 0 0 0
Column 6
B=
4.5000
-10.0000
1.5000
-3.0000
7.5000
35.0000
>> T=A\B
T=
0.0000
-0.0000
-0.0026
0.0804
0.1616
-10.0000
>> X = [-1000:0.1:1000];
>> Y = (-0.0026).*X.*3+0.0804.*X.^2+0.1616.*X-10;
>> plot(X,Y)
>>