extract data points where the slope (derivative) of the plot changes suddenly
3 views (last 30 days)
Show older comments
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.
Matt J on 23 Jan 2023
Edited: Matt J on 23 Jan 2023
data=[ 1 2 3 4 3 2 1]
loc=abs(diff(data,2)) > 1
loc=[false, loc ,false]; %pad with zeros because diff() shortens the vector by two
data_extraction = data(loc)
Find more on Line Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!