Trying to differentiate these B-Splines over [0,1], where n : order of b-spline, u : breaks.
I do not have the curve fitting toolbox and I have already tried to find something here/on stackexchange, but nothing seems to work. I'd appreciate help or explanation/ pointing out my mistakes or just plain code to make it work. Thanks!
function y = splines(u,n)
y = ((u/(n-1)).*splines (u,n-1))+ (((n-u)/(n-1)).*splines(u-1,n-1));
y = zeros(size(u));
ind = find(u>0 & u<2) ;
y(ind) = 1 - abs(u(ind)-1);