Run regressions and output the result as a report using "Report Generator"
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
alpedhuez
am 17 Jan. 2021
Bearbeitet: alpedhuez
am 23 Jan. 2021
I run regressions such as
fitlm(T.population, T.sales)
I want to output a report that explains
- these regression equations and comments
- output of fitlm
I looked at "Matlab Report Generator" https://www.mathworks.com/products/matlab-report-generator.html but I do not see an example that helps me get started. Thank you.
0 Kommentare
Akzeptierte Antwort
Raynier Suresh
am 21 Jan. 2021
Bearbeitet: Raynier Suresh
am 21 Jan. 2021
I have written a simple code which will generate a report similar to what you expect. You can customize it based on your needs
import mlreportgen.report.*
import mlreportgen.dom.*
R = Report('Sample','pdf'); % Create a pdf report with name 'Sample'
open(R)
add(R,'MATLAB REPORT FOR LINEAR MODEL') % Add a heading to the report
X = [0 0;0 1;1 0;1 1]; % Data Martix X
Y = [0;1;2;3]; % Responses Y
mdl = fitlm(X,Y) % fit linear regression model
add(R,' ')
add(R,strcat('Linear Regression Model : ',mdl.Formula.LinearPredictor)) % add the formula of model to report
add(R,' ')
add(R,'Estimated Coefficients: ')
add(R,' ')
Tab = Table(mdl.Coefficients) % add the estimated Coefficients
add(R,Tab)
close(R)
1 Kommentar
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Regression finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!