FUNCTION REFERENCE
cummax
Cumulative maximum.
Cumulative maximum.
Syntax
M = cummax(A)Syntax
M = cummax(A, dim)Syntax
M = cummax(A, 'reverse')Syntax
[M, I] = cummax(A)Running maximum along the first non-singleton dimension, or along dim. Leading NaN
values are kept as they are (complex(1, NaN) stays 1+NaNi); later NaN values are
skipped. I holds the index of each running maximum.
A logical input gives a logical result; character input is an error; complex values
compare by magnitude.
Example
cummax([1 3 2 5 4]) % [1 3 3 5 5]Differences from MATLAB: no integer or single classes. The second output I is a
MatRust extension; MATLAB accepts only one output. Ties in I take the first index.
These are the engine’s help pages. Each page keeps its compatibility notes. File operations are unavailable in the browser.