export function as a string after fitting with linear model
1 view (last 30 days)
Show older comments
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
0 Comments
Answers (0)
See Also
Categories
Find more on Regression 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!