I have rows of 2D data points. I want to get a interpolating B-spline surface(interpolating each row of data point to get interpolating B-spline curves and then interpolating curves to get B-spline surface) so I extended the data to 3D (by adding z-coordinate). But when finding the control points by solving linear system of equation (Bx = D, D:data-points, B:b-spline basis matrix,), I get warning "Matrix is singular to working precision" and almost all the control points are 0.0000 times e+06 after a few starting ones.