how do I extract the spline model and coefficients after I use fit with cubicinterp?

2 views (last 30 days)
I am using the fit() function to fit a cubic spline model to a set of 3D points. I then want to find out the details of the spline model generated and its coefficients so I can use that in further processing. I do this:
sfL = fit([vxL, vyL],vzL,'cubicinterp');
coeffsL = coeffvalues(sfL);
But do not know how to extract anything from coeffsL. How do I go about this? Previously I had done a polynomial fit to the same data as follows:
sf = fit([vx, vy],vz,'poly22');
coeffs(iVhi,:) = coeffvalues(sf);
Here I understood what 'poly22' meant from the documentation, and could extract the coeffs easily and use them to evaluate the polynomial for any point in parameter space.

Answers (1)

John D'Errico
John D'Errico on 6 Jun 2017
Edited: John D'Errico on 6 Jun 2017
A spline fit is not a simple function you can write down easily.
You can evaluate it at any point, and you are always given tools to do that evaluation. But you won't find anything useful by seeing analytical expressions of those functions. It would be messy as hell, and mean absolutely nothing to you.
Sorry.

Categories

Find more on Linear and Nonlinear Regression in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!