%% Annotated Matlab transcript -- 4/5 %% CS 323 - Doug DeCarlo % Matlab spline example % the data: samples of f(x) = 1/x x = [ 1 2 3 4 ]; y = 1./x; plot(x,y) % domain for evaluating the spline xx = 1:0.01:4; plot(xx,1./xx) % spline interpolant yy = spline(x,y,xx); plot(x,y,'ro',xx,yy) % plot of spline and original function plot(x,y,'ro',xx,yy,xx,1./xx)