~ubuntu-branches/ubuntu/hoary/scilab/hoary

« back to all changes in this revision

Viewing changes to macros/mtlb/mtlb_cumsum.sci

  • Committer: Bazaar Package Importer
  • Author(s): Torsten Werner
  • Date: 2005-01-09 22:58:21 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050109225821-473xr8vhgugxxx5j
Tags: 3.0-12
changed configure.in to build scilab's own malloc.o, closes: #255869

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
function r=mtlb_cumsum(a)
 
1
function B=mtlb_cumsum(A,dim)
2
2
// Copyright INRIA
3
 
if type(a)==4 then a=bool2s(a);end
4
 
if size(a,1)==1|size(a,2)==1 then
5
 
  r=cumsum(a)
 
3
// Emulation function for Matlab cumsum()
 
4
// V.C.
 
5
 
 
6
[lhs,rhs]=argn()
 
7
 
 
8
if rhs==1 then
 
9
  if size(a,1)==1|size(a,2)==1 then
 
10
    r=cumsum(a)
 
11
  else
 
12
    r=cumsum(a,firstnonsingleton(A))
 
13
  end
6
14
else
7
 
  r=cumsum(a,1)
 
15
  if dim<=size(size(A),"*") then
 
16
    B=cumsum(A,dim)
 
17
  else
 
18
    B=A
 
19
  end
8
20
end
 
21
endfunction