MATLAB: Getting the linear portion of a non-linear curve

gradientlinearMATLAB

Hello,
I am trying to extract the linear section of a non-linear curve. (See picture attached – I would like to get only the section between the red lines). I also attach the data for that curve – it is data obtained from mechanical testing.
I have tried taking the 2nd derivative but so far I have not managed to do this.
Would you have any suggestions?
Thank you.
Salomé

Best Answer

The ischange function may be of use to you. Depending on what you're planning to do with this data the detrend function may also be of interest.