% test11.m
% övningstest i Matlab för TD 2008

clear all 
clf

a=0.05; A=-1+a; B=1-a;
x=linspace(A,B);

y1=funk11(x,1);
y2=funk11(x,2);
y3=funk11(x,3);
y5=funk11(x,5);
y10=funk11(x,10);
y15=funk11(x,15);
y=1./(1-x);

plot(x,y1, x,y2, x,y3, x,y5, x,y10, x,y15, x,y)
legend('n=1', 'n=2','n=3','n=5','n=10','n=15','n=\infty')

% extra uppgift
x=0.5;
for n=1:20
    yy(n)=funk11(x,n);
end
n=1:20;

y=1/(1-x);
felet=abs(yy-y);

format long
tabell=[n', felet']
