%lecture 7
x = 0:3;
y = [-5 -6 -1 16];
disp([x; y])
V = vander(x)
c = V\y'
pause
% interpolation
u = -.25:.01:3.25;
v = polyinterp(x,y,u);

plot(x,y,'o',u,v,'-')
%
pause
x = 1:6;
y = [16 18 21 17 15 12];
disp([x; y])
u = .75:.05:6.25;
v = polyinterp(x,y,u);
plot(x,y,'o',u,v,'-');

pause
hold on
u = .75:.05:6.25;
v = piecelin(x,y,u);
plot(x,y,'o',u,v,'r-');

