0001 function [y] = ppval_yp(pp,x)
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016 x = x(:);
0017 y = zeros(length(x),pp.dim);
0018
0019 for i = 1:length(x),
0020 for j = 1:pp.pieces;
0021 if x(i)>=pp.breaks(j) & x(i)<=pp.breaks(j+1),
0022 for k = 1:pp.dim,
0023 if pp.order == 2,
0024 y(i,k) = pp.coefs(k+(j-1)*pp.dim,1)*(x(i) - pp.breaks(j))^1 + pp.coefs(k+(j-1)*pp.dim,2);
0025 elseif pp.order == 3,
0026 y(i,k) = pp.coefs(k+(j-1)*pp.dim,1)*(x(i) - pp.breaks(j))^2 + pp.coefs(k+(j-1)*pp.dim,2)*(x(i) - pp.breaks(j)) + pp.coefs(k+(j-1)*pp.dim,3);
0027 elseif pp.order == 4,
0028 y(i,k) = pp.coefs(k+(j-1)*pp.dim,1)*(x(i) - pp.breaks(j))^3 + pp.coefs(k+(j-1)*pp.dim,2)*(x(i) - pp.breaks(j))^2 + pp.coefs(k+(j-1)*pp.dim,3)*(x(i) - pp.breaks(j)) + pp.coefs(k+(j-1)*pp.dim,4);
0029 end
0030 end
0031 end
0032 end
0033 end
0034
0035
0036
0037
0038
0039
0040