clc
clear all

t = [0 0.5 1 6 7 9];
y = [0 1.6 2.0 2.0 1.5 0];

tler = 0:0.05:9;

p = polyfit(t, y, 5);
y2 = polyval(p, t);
yp = polyval(p, tler);

y3 = interp1(t, y, tler, 'spline');

plot(t, y, 'ro', tler, yp, tler, y3);

interp1(t, y, 4, 'spline')
polyval(p, 4)

