I have a 3D grid/surface (I may be using this terminology wrong), i.e. I have data in x, y, and z, for
z = f(x,y)
I want MATLAB to fit a cubic (or other) spline curve to this data, and then I want to extract the actual mathematical spline function, so I can simply write the algebraic function on my own,
z = my_mathematical_spline_curve_function(x,y)
Instead of using the sfit object. I know I can do this with a polynomial curve fit by using MATLAB's fit tool and then extracting the coefficients. I am looking to do the same kind of thing, but I need splines; a polynomial curve doesn't fit the data well enough. Is this possible to do in MATLAB?