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

    %% Cumulative Sum of Logical Input  

%% 
% Create an array of logical values. 
A = [true false true; true true false]  

%% 
% Find the cumulative sum of the rows of |A|. 
B = cumsum(A,2)  

%% 
% The output has type |double|. 
class(B)