locmax(x, t)
X = seq(-pi,pi,.01) locmax(sin(X),X) locmax(cos(X+pi),X+pi)
Run the code above in your browser using DataLab