MATLAB: Find the increasing and decreasing point in array

array

I have an array. Which is increasing. At one point it starts decreases.
This trend starts repeating many times in array. How to find that point in array where the trend starts?

Best Answer

A=[1 2 3 2 1 4 5 6 7 5 2 0 4 5 6 10]
[peaks,idx]=findpeaks(A)
If you haven't a signal processing toolbox
A=[5 2 3 2 1 4 5 6 7 5 2 0 4 5 6 10]
d=sign([0 diff(A)]);
idx=strfind(d,[1,-1])