If I have a vector that is showing the change in slope (produced by the sign function) how do I find the data point/points when the slope change from 1 to -1.
Example vector
1 1 1 1 -1 -1 -1 -1 1 1 1 1 -1 -1 -1 -1 1 1 1 1
Or is there a way to somehow just have an output that tells me how many minima are in the vector defined by when a line segment with a negative slope is followed by a line segment with a positive slope (/). In the above example there would be two minima so the example output would be:
minima
2
In a perfect world, I would love to have an output that looks like this
Minima Location
1 8
1 9
2 16
2 17