I have a vector, sigma=[s1, s2, s3, s4, s5, s6, s7]
, which is plotted in a cycle loading:
I've seen few methods solving this problem but unfortunately not for MATLAB yet.
How do I identify turning points?
How do I identify non-turning points? (s2,s6)
I am assuming some sigma values which will look similar to what you have plotted. Notice the extra zero in the beginning, that is not labelled in your plot but from the plot it looks like it is a data point:
>> sigma = [0 3 -1 -3 1 -2 0.5 3.5]
>> sign(diff(sigma))
ans =
1 -1 -1 1 -1 1 1
This tells me where sigma
is increasing and where it is decreasing, if we take a diff once more where the diff values will be zero will be non turning points and non zero would be turning points
>> diff(sign(diff(sigma)))
ans =
-2 0 2 -2 2 0
The 1st element corresponds to the 1st point in your plot (not the 1st value of sigma in my array). -ve values indicate concave and +ve indicate convex turning points. Notice how this result only has six elements for seven points, that is because the seventh point is indeterminate.
>>turning = find(diff(sign(diff(sigma))))
>>nonTurningIdx = find(diff(sign(diff(sigma))) == 0)
turning =
1 3 4 5
nonTurningIdx =
2 6