export output from a linear regression to Excel
Show older comments
Is it possible to export the output after having performed a linear regression to Excel? In other words, to export the variable generated in Workspace which contains the coefficients, R^2 and so on? Either exporting all properties contained in the variable/output at once or one property at a time? When copy-pasting the coefficients for instance to Excel, the variable names and column labels are not pasted into Excel which is quite annoying.
Accepted Answer
More Answers (1)
Marina Fernandez
on 21 Sep 2022
0 votes
Another option is to convert the model to text, separate it by rows and convert that to a cell in order to write the results of the model in excel format:
text_model = evalc('disp(model)');
split_text_model = split(text_model,char(10));
xlswrite(excel_path,cellstr(split_text_model),'results','A1');
Categories
Find more on Spreadsheets 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!