OK. This is explained in help in "spapi" MATLAB Command. You can do it as follows.
if true
x = [ 0, 0.125, 2*0.125, 3*0.125, 4*0.125, 5*0.125, 6*0.125, 7*0.125, 8*0.125 ];
y = [0, sin(2*pi*f/8), 1, sin(2*pi*3*f/8), 0, sin(2*pi*5*f/8),-1,sin(2*pi*7*f/8), 0];
k = 6;
sp = spapi(augknt(x,6,2),[x,x,min(x),max(x)],[y,[0 2*pi*cos(2*pi*f/8), 2*pi*cos(2*pi*f/4),2*pi*cos(2*pi*3*f/8),2*pi*cos(2*pi*4*f/8),2*pi*cos(2*pi*5*f/8),2*pi*cos(2*pi*6*f/8),2*pi*cos(2*pi*7*f/8),0],0,0]);
xx = 0:0.001:1;
yy = fnval(xx,sp);
dsp = fnder(sp);
dyy = fnval(xx,dsp);
ddsp = fnder(sp,2);
ddyy = fnval(xx,ddsp);
plot(xx, yy, xx, dyy, xx, ddyy), shg
end