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

조회 수: 2 (최근 30일)
Ali
Ali 2023년 1월 23일
편집: Matt J 2023년 1월 23일
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.

답변 (1개)

Matt J
Matt J 2023년 1월 23일
편집: Matt J 2023년 1월 23일
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

카테고리

Help CenterFile Exchange에서 Annotations에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by