function y = cumsum(x,varargin)
%MATLAB Code Generation Library Function

%   Copyright 2002-2016 The MathWorks, Inc.
%#codegen

coder.inline('always');
narginchk(1,inf);
coder.internal.prefer_const(varargin);
if islogical(x)
    y = double(x);
    y = cumop('cumsum',y,varargin{:});
else
    x = cumop('cumsum',x,varargin{:});
    y = x; % This copy may be removed after inlining.
end
