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

% Copyright 2012 The MathWorks, Inc.