how do I extract the spline model and coefficients after I use fit with cubicinterp?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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.
0 comentarios
Respuestas (1)
John D'Errico
el 6 de Jun. de 2017
Editada: John D'Errico
el 6 de Jun. de 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.
0 comentarios
Ver también
Categorías
Más información sobre Linear and Nonlinear Regression en Help Center y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!