n=3
x=seq(0, 5, length.out=101)
xk=c(rep(0, n+1), 1:4, rep(5, n+1))
# cubic polynomial coefficients
coeffs=parr(xk)
# basis matrix
m=pbsc(x, xk, coeffs)
matplot(x, m, t="l")
stopifnot(all.equal.numeric(c(m), c(bsc(x, xk))))
Run the code above in your browser using DataLab