% -------------- EvalSpline.m ---------------------------- % % function [y] = EvalSpline(c,t,x) % % inputs: c(1:4;1:n-1), t(1:n), x(1:m) % outputs: y(1:m) % % Evaluates the spline function given by coefficients in % the 4-by-(n-1) matrix c with knots t(1),...,t(n) at the % points x to output y-values. % % Thus the computed spline function is given as follows: % when x is in the interval [t(i),t(i+1)], then % Spline(x) = c(4,i)*(t(i+1)-x)^3 + c(3,i)*(x-t(i))^3 + ... % c(2,i)*(x-t(i)) + c(1,i)*(t(i+1)-x) % For efficiency's sake, we require that x(1)<x(2)<...x(m) % function [y] = EvalSpline(c,t,x) disp('%%%%%%%% YOU NEED TO WRITE EvalSpline %%%%%%%%%%')