Force begin/end slope of trendline scatterplot

조회 수: 4 (최근 30일)
Tijmen
Tijmen 2021년 4월 12일
댓글: Tijmen 2021년 4월 13일
Hi,
I have a scatterplot through which I want to plot a trendline. Using polyfit I get a line through my plot as seen in the picture below. This is a 2nd order polyfit. Higher order fits give less fitting lines. The line looks like it has a minimum, which is not desired. What I want to achieve is to fix the slope at x =1 to be 0 so that it has no minimum. How can I do this?

채택된 답변

Jan
Jan 2021년 4월 12일
편집: Jan 2021년 4월 12일
  댓글 수: 1
Tijmen
Tijmen 2021년 4월 13일
Thanks Jan! The second link, the polyfix function, does exactly what I want.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Data Distribution Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by