trend line calculation and display

235 次查看(过去 30 天)
Hi, how can I obtain and display a trend line from some points? I need the equation of the trend line. Thanks

采纳的回答

Harry MacDowel
Harry MacDowel 2011-10-17
First, plot the data like usual.
Then go to Tools -> Basic Fitting
Choose one of the fittings you like, then check Show Equation
Remember to click the Right Arrow key at the bottom right to view the values of the coefficients for the fit.

更多回答(2 个)

Sarah Weihmann
Sarah Weihmann 2017-3-14
Hi Aravind S,
try the fit command for trendline calculation: http://de.mathworks.com/help/curvefit/fit.html Display the equation y=m*x+n as >> m=3; >> n=4; >> legend(sprintf('y=%f*x+%f',m,n));
Cheers, S

aravind S
aravind S 2017-2-9
Is there command available?
  1 个评论
Pablo López
Pablo López 2018-6-27
编辑:Pablo López 2018-6-27
Sure! Take a look of polyfit for polynomial curve fitting.
Hope that helps!

请先登录,再进行评论。

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by