Add 2 trendlines to scatter plot
Show older comments
Hi, I want to make a scatter plot and then add a liner fit line as well as a exponential fit line to the scatter plot and display the equations on on the plot.
I know how to plot the exponential fit line using:
x = SZA15(:,9);
y = SZA15(:,5);
f = fit(x,y,'exp1')
plot(f,x,y)
but I am not sure how to do the linear fit line.
1 Comment
dpb
on 28 Jun 2017
Not sure if you got this far where the problem is...
f2 = fit(x,y,'poly1');
hold all
plot(f2,x,y)
should do it, doesn't it?
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!