Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.3.0 - 日本語

Change language to:
English - Français - Português

Please note that the recommended version of Scilab is 2024.1.0. This page might be outdated.
See the recommended documentation of this function

Scilab manual >> Elementary Functions > cumsum

cumsum

累積和

呼び出し手順

y=cumsum(x)
y=cumsum(x,'r') or y=cumsum(x,1)
y=cumsum(x,'c') or y=cumsum(x,2)

パラメータ

x

ベクトルまたは行列 (実数または行列r)

y

ベクトルまたは行列 (実数または行列)

説明

xがベクトルまたは行列の場合, y=cumsum(x) は, 列方向に取得したxの全エントリの 累積和をyに返します.

y=cumsum(x,'c') (または, 等価的に, y=cumsum(x,2)) は xの列の累積和をyに 返します: y(i,:)=cumsum(x(i,:))

y=cumsum(x,'r') (または, 等価的に, y=cumsum(x,1)) は xの行の累積和をyに 返します: y(:,i)=cumsum(x(:,i))

y=cumsum(x,'m')xの最初の1より大きい次元方向の 累積和となります(Matlabとの互換性用).

A=[1,2;3,4];

cumsum(A)
cumsum(A,'r')
cumsum(A,'c')

a=rand(3,4)+%i;
[m,n]=size(a);
w=zeros(a);
w(1,:)=a(1,:);
for k=2:m;
  w(k,:)=w(k-1,:)+a(k,:);
end;
w-cumsum(a,'r')

参照

<< cumprod Elementary Functions delip >>

Copyright (c) 2022-2024 (Dassault Systèmes)
Copyright (c) 2017-2022 (ESI Group)
Copyright (c) 2011-2017 (Scilab Enterprises)
Copyright (c) 1989-2012 (INRIA)
Copyright (c) 1989-2007 (ENPC)
with contributors
Last updated:
Wed Jan 26 16:25:03 CET 2011