MATLAB: Determining turning points about a peak in plots

turning point

The plot below depicts peak linear acceleration associated with an impact.
It is my goal to determine the precise duration of this impact, that is, by identifying the first major turning points on either side of the peak value.
I am somewhat novice to Matlab and would greatly appreciate guidance.
Thank you, John

Best Answer

I suggest taking the numerical derivative, at least initially:
dydt = diff([0 LinAccel]) ./ diff([0 Time]);
and look for the appropriate sign reversals. I don’t know how noisy your data are, so you will have to take that into consideration as you interpret the derivative data. (The code snippet here is for row vectors for your variables. For column vectors, put a semicolon (;) after the first zero in the diff statement vectors.)