Navigation

Operators and Keywords

Function List:

C++ API

: cummax (x)
: cummax (x, dim)
: [w, iw] = cummax (…)

Return the cumulative maximum values along dimension dim.

If dim is unspecified it defaults to column-wise operation. For example:

cummax ([1 3 2 6 4 5])
  ⇒  1  3  3  6  6  6

If called with two output arguments the index of the maximum value is also returned.

[w, iw] = cummax ([1 3 2 6 4 5])
⇒
w =  1  3  3  6  6  6
iw = 1  2  2  4  4  4

See also: cummin, max, min.

Package: octave