Plotting multiple linear models on one plot
Show older comments
Hi all,
I have a dataset and I am fitting multiple linear models to it. The first model is fit to the first 1/3 section of the data, the second model is fit to the first 2/3 section of the data, the third model is fit to the last 2/3 section of the data, the fourth model is fit to the last 2/3 section of the data and the last model is fit to all data.
I am using the fitlm fucntion to generate these linear models and the numbers of the mdl=fitlm() function match what I am seeing in excel (error <1%). However, when I try to visualize all the data on one plot I am getting all the linear models in red. So it is very hard to differentiate between one model or the other. Any idea how to change the color of each linear plot?
Thanks,
Accepted Answer
More Answers (0)
Categories
Find more on Linear and Nonlinear 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!