
function y=bsplP(p,x)
%y--value of the B-spline of  order 'p' at the point 'x' 
%the B-spline is designed on the  grid with the step 1 
bc=mfun('binomial',p,0:p+1);
fct=factorial(p-1);
 if x>=p|x<=0

    y=0;
     return
end
z=x;
s=0;k=0;
while z>0
s=s+((-1)^k)*(z^(p-1))*bc(k+1);
z=z-1;
k=k+1;
end
y=s/fct;