% jardin tiene 10 metros de ancho
x1 = 0:.5:10;

% el largo no es igual
y1 = [2.5 2.8 3 3.3 3.8 4.8 4.8 5 4.8 4.7 4.7 4.5 4.5 4.4 4.3 4.4 4.2 4 4.1 ...
    4.3 3.5];

p = polyfit(x1,y1,20);

xplot = linspace(0,10,200);
plot(x1,y1,'o')
hold on
plot(xplot,polyval(p,xplot),'r');
axis([0 10 0 6])

% spline cubico
svals = jardin(xplot);
plot(xplot,svals,'k');

legend('puntos','polinomio','spline cubico')



