www.gusucode.com > matlab 案例源码 matlab代码程序 > matlab/CumulativeMaximumValuesinVectorExample.m

    %% 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)