Automatically insert coefficients in surface fit

When I fit a surface to data points, the output is something like this.
data(x,y) = p00 + p10*x + p01*y
Coefficients (with 95% confidence bounds):
p00 = 0.004555 (0.004179, 0.004931)
p10 = -0.0002772 (-0.0003244, -0.00023)
p01 = 2.366 (-0.3953, 5.128)
But because I need to to use this function very often, manually inserting the coefficients in the right place is getting tedious and time-consuming.
Is there any way for matlab to do this automatically? Giving me an output like
data(x,y) = 0.004555 - 0.0002772*x + 2.366*y
(I exclusively use polynomials, so don't worry about the other fitting methods.)
Thank you.

 Réponse acceptée

You can use fprintf()
fprintf('data(x,y) = %.4f + %.4f*x + %.4f*y\n', data.p00, data.p10, data.p01)

2 commentaires

Thank you!
I am glad to be of help!

Connectez-vous pour commenter.

Plus de réponses (0)

Catégories

En savoir plus sur Descriptive Statistics dans Centre d'aide et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by