Scilab Website | Contribute with GitLab | Mailing list archives | ATOMS toolboxes
Scilab Online Help
5.5.0 - Português

Change language to:
English - Français - 日本語 - Русский

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

Ajuda do Scilab >> Funções Elementares > Matrix operations > cumsum

cumsum

soma cumulativa

Seqüência de Chamamento

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

Parâmetros

x

vetor ou matrix (de reais ou complexos)

y

vetor ou matrix (de reais ou complexos)

Descrição

Para um vetor ou uma matriz x, y=cumsum(x) retorna em y a soma cumulativa de todas as entradas de x tomadas coluna a coluna.

y=cumsum(x,'c') (ou, equivalentemente, y=cumsum(x,2)) retorna em y a soma cumulativa das colunas de x: y(i,:)=cumsum(x(i,:))

y=cumsum(x,'r') (ou, equivalentemente, y=cumsum(x,1)) retorna em y a soma cumulativa das linhas de x: y(:,i)=cumsum(x(:,i))

y=cumsum(x,'m') é a soma cumulativa ao longo da primeira dimensão "não-singleton" de x (para compatibilidade com o Matlab).

Exemplos

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

Ver Também

  • cumprod — produto cumulativo
  • sum — soma (soma linha, soma coluna) de entradas de um vetor ou matriz
Report an issue
<< cumprod Matrix operations kron >>

Copyright (c) 2022-2023 (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:
Fri Apr 11 14:18:11 CEST 2014