1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
3
<!-- When this file is modified please also modify mtlb_cumsum.xml -->
5
<LANGUAGE>eng</LANGUAGE>
6
<TITLE>mtlb_cumsum</TITLE>
7
<TYPE>M2SCI function</TYPE>
10
<SHORT_DESCRIPTION name="mtlb_cumsum">Matlab cumsum emulation function</SHORT_DESCRIPTION>
14
<P>Matlab and Scilab <VERB>cumsum</VERB> behave differently in some particular cases:</P>
21
When used with one input (<VERB>cumsum(A)</VERB>), Matlab <VERB>cumsum</VERB>
22
treats the values along the first non-singleton dimension of A as vectors while
23
Scilab <VERB>cumsum</VERB> treats all A values.
29
When used with two inputs (<VERB>cumsum(A,dim)</VERB>), Matlab tolerates <VERB>dim</VERB>
30
to be greater than the number of dimensions of A while Scilab returns an error message in this case.
38
The function <VERB>R = mtlb_cumsum(A[,dim])</VERB> is used by
39
<VERB>mfile2sci</VERB> to replace <VERB>cumsum(A[,dim])</VERB> when it was not
40
possible to know what were the inputs while porting Matlab code to Scilab. This function will
41
determine the correct semantic at run time. If you want to have a
42
more efficient code it is possible to replace <VERB>mtlb_cumsum</VERB> calls:
50
If <VERB>dim</VERB> is less equal to the number of dimensions of A
51
<VERB>R = mtlb_cumsum(A,dim)</VERB> may be replaced by <VERB>R = cumsum(A,dim)</VERB>
57
If <VERB>dim</VERB> is greater than then number of dimensions of A
58
<VERB>R = mtlb_cumsum(A,dim)</VERB> may be replaced by <VERB>R = A</VERB>.
65
<P>Caution: <VERB>mtlb_cumsum</VERB> has not to be used for hand coded functions.</P>
70
<SEE_ALSO_ITEM> <LINK>firstnonsingleton</LINK> </SEE_ALSO_ITEM>
74
<AUTHORS_ITEM>V.C.</AUTHORS_ITEM>