export function as string after fitting to LinearModel
Afficher commentaires plus anciens
Hi all,
I'm using stepwiselm for regression. The function returns a LinearModel with a lot of stuff in it. It seems difficult however, to extract the exact function from the linear model as a string. In this way I could print it in a textfile.
So given the example
load carbig
tbl = table(Acceleration,Displacement,Horsepower,Weight,MPG);
mdl1 = stepwiselm(tbl,'ResponseVar','MPG','Upper','quadratic')
I'm looking for a way to get a result like this
model = 'MPG=63.558-0.25084*Horsepower-0.010772*Weight+5.3554e-05*Horsepower*Weight'
Is there an (easy) way to do this?
Thanks, Steven
Réponses (0)
Catégories
En savoir plus sur Linear Predictive Coding 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!