Search code examples
matlabbspline

generating and plotting a matrix of bsplines with different positions and width


I am able to create a set of bsplines in a single plot. However, I would like to create a matrix of individual bsplines, whereby each matrix row contains a single bspline from range 1950 to 20150, in the way depicted in the drawing. The bsplines should have the same height with coefficient of 1. The next bspline in the library will be spaced one knot apart from the first bspline and so on until the entire width is taken, depending on the width of the bspline. Then, starting from the left-most again, a bspline of twice the width of the previous bspline is added to the reference set. Then a bspline for the same width is added 1 knot apart from the first and so on… This process will continue until the bspline become so wide that one bspline is able to fit the entire width.

Also, a bonus question: is there any nice functions for plotting all the functions described above in a way similar to the drawing?

current attempt

B = spcol([0, 0, 0, linspace(0,1,20), 1, 1, 1], 4, linspace(0,1,100)); plot(B);

Spline


Solution

  • The approach is to plot each bspline individually.