Display the formula of a fitted model with its coefficient values

1 回表示 (過去 30 日間)
manuel FOSSA
manuel FOSSA 2016 年 9 月 6 日
回答済み: manuel FOSSA 2016 年 9 月 7 日
I have an sfit model from a 5 degrees polynomial fit of a surface.
The formula for the object is of the form:
p00 + p10*x + p01*y + p20*x^2 + p11*x*y + p02*y^2 + p30*x^3
+ p21*x^2*y + p12*x*y^2 + p03*y^3 + p40*x^4 + p31*x^3*y
+ p22*x^2*y^2 + p13*x*y^3 + p04*y^4 + p50*x^5 + p41*x^4*y
+ p32*x^3*y^2 + p23*x^2*y^3 + p14*x*y^4 + p05*y^5
I would just like to display (as a character string) the formula but with its coefficients values instead of their names (that is 19.33 instead of p00, and so on..). In the sfit methods i only found methods to either display the formula in literal form or the coefficients values but not both at the same time.
Is there any possibility to do so?

採用された回答

manuel FOSSA
manuel FOSSA 2016 年 9 月 7 日
Found the solution which is of the form
formula_fitted=formula(fittedmodel)
paste and copy the formula then
disp([num2str(fittedmodel.p00) '+' num2str(fittedmodel.p10) '*x' '+' num2str....])

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeLinear and Nonlinear Regression についてさらに検索

タグ

製品

Community Treasure Hunt

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

Start Hunting!

Translated by