How can I save cubic spline coefficients for a cubic spline fit to a surface?
2 views (last 30 days)
Show older comments
I am essentially asking the same questions as here:
except instead of having data for x --> y, I have [x,y] ---> z. I want to fit a cubic spline to this data in MATLAB, and then extract the coefficients so I can create the mathematical spline function myself, in the form of
function z = mysplinefunction(x,y)
Just like how I could fit a polynomial curve, and then extract the coefficients and use them to write my own expression. Can this be done?
2 Comments
John D'Errico
on 6 Apr 2016
CAN it be done? Of course it can be done. But you need, in this case, to learn how to use splines, how to build them.
First, you should spend some time learning what a spline is, how to build one in ONE dimension, how the coefficients of the spline might be stored. Once you are FULLY comfortable in performing these computations (I think you are not yet there, from what you have said so far) then learn how you might write tools like a tensor product spline, thus a spline in two dimensions, as a function of two independent variables as you wish to do.
Answers (0)
See Also
Categories
Find more on Splines in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!