LOCAL_MAXMIN finds positions and values of local maxs and mins of x [p,a]=local_max(x) Test: x=[[1:5],[4:-1:1],[1:4],[3:-1:1]],plot(x),[p,a]=local_maxmin(x),grid on x=[[1:5],[4:-1:1],[2:4],[3:-1:1],[2:3],[2:-1:1]],plot(x),[p,a]=local_maxmin(x), grid on See also LOCAL_MAX Auteur : A. Djafari