Interpolasi Linear dengan Pelatihan
Posted by admin on April 6th, 2011
function linear01;
close all;
clear all;
clc;
fy = [ ...
0 1.0714;...
0.1000 1.2124;...
0.3000 1.2358;...
0.4000 1.3254;...
0.5000 1.0906;...
0.8000 1.3600;...
0.9000 1.5190;...
1.0000 1.5816 ];
xx = fy(:,1);
% A = [ ((fy(end,2)-fy(1,2))/(fy(end,1)-fy(1,1))) fy(1,2)]; % randn(1,2);
A = [1 fy(1,2)];
galat = 1;
n = 1;
terr(1) = 1;
yy = A(1,1).*xx + A(1,2);
while (abs(galat)>0.00001)
n=n+1;
err1 = fy(:,2)-yy;
err2 = abs(err1);
terr1(n) = sum(err1);
terr2(n) = sum(err2);
A(1,1) = (A(1,1)+0.1*terr1(n));
yy = A(1,1).*xx + A(1,2);
err1 = fy(:,2)-yy;
err2 = abs(err1);
terr1(n) = sum(err1);
terr2(n) = sum(err2);
A(1,2) = (A(1,2)+0.1*terr1(n));
galat = terr1(n)-terr1(n-1);
yy = A(1,1).*xx + A(1,2);
end;
terr1
A
subplot(2,1,1);
plot(xx,yy,’-bd’,'LineWidth’,1,’MarkerEdgeColor’,'k’,'MarkerFaceColor’,[.5 .5 .5],’MarkerSize’,12); hold on;
x = fy(:,1);
y = fy(:,2);
plot(x,y,’-wo’,…
‘LineWidth’,2,…
‘MarkerEdgeColor’,'k’,…
‘MarkerFaceColor’,[.49 1 .63],…
‘MarkerSize’,12); grid on;
subplot(2,1,2);
plot(terr1,’-bd’,'LineWidth’,1,’MarkerEdgeColor’,'k’,'MarkerFaceColor’,[.5 .5 .5],’MarkerSize’,12); hold on;
plot(terr2,’-ro’,'LineWidth’,1,’MarkerEdgeColor’,'k’,'MarkerFaceColor’,[.5 .5 .5],’MarkerSize’,12); grid on;
end
.
terr1 =
0 -1.3050 -0.1566 -0.0188 -0.0023 -0.0003 -0.0000 -0.0000 -0.0000
A =
0.7528 0.9231
>>

February 8th, 2013 at 9:40 pm
4 star hotels in benalmadena costa spain…
Risanuri Hidayat » Blog Archive » Interpolasi Linear dengan Pelatihan…
February 9th, 2013 at 8:56 pm
Albox apartments for sale…
Risanuri Hidayat » Blog Archive » Interpolasi Linear dengan Pelatihan…
March 15th, 2013 at 5:05 pm
sklandymas.lt…
Risanuri Hidayat » Blog Archive » Interpolasi Linear dengan Pelatihan…
March 21st, 2013 at 3:43 pm
oxford intellectual property law moot 2013…
Risanuri Hidayat » Blog Archive » Interpolasi Linear dengan Pelatihan…