% Subroutine used to construct and evaluate the spline % once the coefficients aj's, ... dj's have been computed. % It can be applied to both free or natural or clamped boundaries. function [vp]=splp(x,a,b,c,d,p,N) for i=1:N-1 if p>=x(i) & p=x(N), vp=a(N-1)+b(N-1).*(p-x(N-1))+c(N-1).*(p-x(N-1)).^2+d(N-1)*(p-x(N-1)).^3; break, end; end