%CreateBkN.m %Math 128B Spring 2005 %Returns B1(i,j)=Bjk(Xi) % =j'th B-spline (k > 1) evaluated at Xi %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %Functions called: %BSpline, CreateOmega %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% function [X, B1] = CreateBkN(knots, k, N) %X = knots(1):h:knots(end); knotN = length(knots); X = []; for j=2:knotN h = (knots(j)-knots(j-1))/(N-1); X = [X(1:end-1) knots(j-1):h:knots(j)]; end %create B1 whose (i,j) entry is Bj,1(Xi) B1 = BSpline(X, knots); for K=2:k B = B1; %create Omega and then B2 whose (i,j) entry is Bj,k(Xi) w = CreateOmega(X, knots, K); B1 = B(:,1:end-1) .* w(:,1:end-1) + B(:,2:end) .* (1 - w(:,2:end)); end return