Force begin/end slope of trendline scatterplot

7 Ansichten (letzte 30 Tage)
Tijmen
Tijmen am 12 Apr. 2021
Kommentiert: Tijmen am 13 Apr. 2021
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?

Akzeptierte Antwort

Jan
Jan am 12 Apr. 2021
Bearbeitet: Jan am 12 Apr. 2021
  1 Kommentar
Tijmen
Tijmen am 13 Apr. 2021
Thanks Jan! The second link, the polyfix function, does exactly what I want.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Data Distribution Plots finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by