%% Cumulative Maximum Values in Vector
% Find the cumulative maxima of a 1-by-10 vector of random integers.

v = randi(10,1,10)

%

M = cummax(v)

% Copyright 2012 The MathWorks, Inc.