# Find value at which a line changes its slope

16 Ansichten (letzte 30 Tage)
Lina Koronfel am 28 Mai 2023
Kommentiert: Lina Koronfel am 23 Jul. 2023
How can I find the x value of the point during which the line (significantly) changes direction? I tried inflection point but it doesn't work in this case. Basically, I want to find the exact value during which the line changes its slope (arrow). Thank you
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Akzeptierte Antwort

Image Analyst am 28 Mai 2023
See if my attached piecewise linear fit identifies it correctly for you.
And as an alternative:
##### 1 Kommentar-1 ältere Kommentare anzeigen-1 ältere Kommentare ausblenden
Lina Koronfel am 23 Jul. 2023
Thank you for the answer, I wrote a code that incorporated all suggestions from @John D'Errico @Torsten and @Image Analyst and it is working perfectly. Thank you for all your help!

Melden Sie sich an, um zu kommentieren.

### Weitere Antworten (2)

Torsten am 28 Mai 2023
Verschoben: Torsten am 28 Mai 2023
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

John D'Errico am 28 Mai 2023
Bearbeitet: John D'Errico am 28 Mai 2023
There is NO exact point where that can be known to happen. Your curve is noisy.
At best, you can estimate where the curve starts to drift away from being a constant function. And of course, we lack any data from you, so it is difficult to give an example.
It seems your curve is essentially zero for a while, so why not just look for the point where y deviates from zero by some tolerance? That is the point you are essentially asking to find.
We can compute the approximate noise in your curve simply as:
noiseEst = std(diff(y))/sqrt(2);
This assumes the noise is additive and iid, and at least vaguely gaussian. It also assumes the signal underneath the noise in the curve is slowly varying.
Having done that, just find the point where
ind = find(abs(y) > 3*noiseEst,1,'first')
That gives you the first point where y deviates from zero by more than 3 sigma.
##### 0 Kommentare-2 ältere Kommentare anzeigen-2 ältere Kommentare ausblenden

Melden Sie sich an, um zu kommentieren.

### Kategorien

Mehr zu Resampling Techniques 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