trend line calculation and display

조회 수: 554 (최근 30일)
Nello Troccia
Nello Troccia 2011년 10월 17일
댓글: Alex Backer 2020년 6월 1일
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