Cumulative maximum
returns
the cumulative maximum elements of M = cummax(A)A. By default, cummax(A) operates
along the first array dimension whose size does not equal 1.
If A is a vector, then cummax(A) returns
a vector of the same size containing the cumulative maxima of A.
If A is a matrix, then cummax(A) returns
a matrix of the same size containing the cumulative maxima in each
column of A.
If A is a multidimensional array,
then cummax(A) returns an array of the same size
containing the cumulative maxima along the first array dimension of A whose
size does not equal 1.
The 'reverse' option in many cumulative
functions allows quick directional calculations without requiring
a flip or reflection of the input array.