extract data points where the slope (derivative) of the plot changes suddenly

3 Ansichten (letzte 30 Tage)
Ali
Ali am 23 Jan. 2023
Bearbeitet: Matt J am 23 Jan. 2023
Hi,
Is it possible to extract (or select) data points from a plot that have a massive change in the tangent (derivative) before and after them?
I mean the data points where the slope (derivative) of the plot changes suddenly.
I cannot do it manually because there are lots of data points.

Antworten (1)

Matt J
Matt J am 23 Jan. 2023
Bearbeitet: Matt J am 23 Jan. 2023
data=[ 1 2 3 4 3 2 1]
data = 1×7
1 2 3 4 3 2 1
loc=abs(diff(data,2)) > 1
loc = 1×5 logical array
0 0 1 0 0
loc=[false, loc ,false]; %pad with zeros because diff() shortens the vector by two
data_extraction = data(loc)
data_extraction = 4

Kategorien

Mehr zu 2-D and 3-D Plots finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by