% Plot exact y values against cubic spline y values % and compute absolute error clear close all load hw31.dat x = hw31(:,1); y = hw31(:,2); S = spline(x,y); xo = linspace(x(1),x(end),51)'; yo = ppval(xo,S); yexact = hw31fun(xo); re = (yo-yexact); figure(2) semilogy(xo,abs(re))