rendered paste body% $Id: polyf.m,v 1.23 2006/11/09 18:05:45 panos Exp $
format long
xrwma = [{'kx-'}, {'ko-'}, {'k*-'}, {'kv-'}, {'kp-'}];
n = [50 100 200 400 800];
pvin = 50:10:850;
% apotelesma erwthmatos 3.1
Y1 = erwthma31(2);
% apotelesma erwthmatos 3.2
Y2 = erwthma32(2);
% apotelesma erwthmatos 3.4
Y4 = erwthma34(2);
% P1 = [2 0 0];
% P2 = [2 0 0 0];
% P3 = [2/3 0 0 0];
%
% pvout1 = polyval(P1, pvin);
% pvout2 = polyval(P2, pvin);
% pvout3 = polyval(P3, pvin);
% GER
figure;
hold on;
grid on;
for N = 2:5
pfout1 = polyfit(n, Y1, N);
pvoutGER = polyval(pfout1, pvin);
plot(pvin, pvoutGER, char(xrwma(N-1)));
end
plot(n, Y1, char({'r*-'}));
title = ('A + b*c');
xlabel = ('pvin (50:10:850)');
ylabel = ('mean time');
legend('N = 2', 'N = 3', 'N = 4', 'N = 5', 'Y1', 'Location', 'BestOutside');
hold off