~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/differential_equations/help/en_US/diff.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="UTF-8"?>
 
2
<!--
 
3
 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 
4
 * Copyright (C) 2008 - INRIA
 
5
 * 
 
6
 * This file must be used under the terms of the CeCILL.
 
7
 * This source file is licensed as described in the file COPYING, which
 
8
 * you should have received as part of this distribution.  The terms
 
9
 * are also available at    
 
10
 * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
11
 *
 
12
 -->
 
13
<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="diff" xml:lang="en">
 
14
    <refnamediv>
 
15
        <refname>diff</refname>
 
16
        <refpurpose>Difference and discrete derivative</refpurpose>
 
17
    </refnamediv>
 
18
    <refsynopsisdiv>
 
19
        <title>Calling Sequence</title>
 
20
        <synopsis>y=diff(x)
 
21
            y=diff(x [,n [,dim]])
 
22
        </synopsis>
 
23
    </refsynopsisdiv>
 
24
    <refsection>
 
25
        <title>Arguments</title>
 
26
        <variablelist>
 
27
            <varlistentry>
 
28
                <term>x</term>
 
29
                <listitem>
 
30
                    <para>vector or matrix (real, complex, sparse or polynomial)</para>
 
31
                </listitem>
 
32
            </varlistentry>
 
33
            <varlistentry>
 
34
                <term>n</term>
 
35
                <listitem>
 
36
                    <para>integer the order of differentiation</para>
 
37
                </listitem>
 
38
            </varlistentry>
 
39
            <varlistentry>
 
40
                <term>dim</term>
 
41
                <listitem>
 
42
                    <para>integer or character string with values "r","c" and "*"</para>
 
43
                </listitem>
 
44
            </varlistentry>
 
45
            <varlistentry>
 
46
                <term>y</term>
 
47
                <listitem>
 
48
                    <para>scalar or vector/matrix</para>
 
49
                </listitem>
 
50
            </varlistentry>
 
51
        </variablelist>
 
52
    </refsection>
 
53
    <refsection>
 
54
        <title>Description</title>
 
55
        <para>
 
56
            <literal>y=diff(x)</literal> compute the difference function
 
57
            <literal>y=x(2:$)-x(1:$-1)</literal>
 
58
        </para>
 
59
        <para>
 
60
            <literal>diff(x,n,dim)</literal> is the <literal>n</literal>th
 
61
            difference function along dimension <literal>dim</literal>.
 
62
        </para>
 
63
        <para>
 
64
            <literal>diff(x,n,"*")</literal> is equivalent to
 
65
            <literal>diff(x(:),n)</literal>.
 
66
        </para>
 
67
        <para>
 
68
            Default value for <literal>n</literal> is 1. Default value for
 
69
            <literal>dim</literal> is <literal>"*"</literal>.
 
70
        </para>
 
71
        <para>
 
72
            <literal>dim='r'</literal> is equivalent to <literal>dim=1</literal>
 
73
            and <literal>dim='c'</literal> is equivalent to
 
74
            <literal>dim=2</literal>.
 
75
        </para>
 
76
    </refsection>
 
77
    <refsection>
 
78
        <title>Examples</title>
 
79
        <programlisting role="example"><![CDATA[ 
 
80
v=(1:8)^3;
 
81
diff(v)
 
82
diff(v,3)
 
83
 
 
84
A=[(1:8)^2
 
85
   (1:8)^3
 
86
   (1:8)^4];
 
87
 
 
88
diff(A,3,2)
 
89
 
 
90
//approximate differentiation
 
91
step=0.001
 
92
t=0:step:10;
 
93
y=sin(t);
 
94
dy=diff(sin(t))/step; //approximate differentiation of sine function
 
95
norm(dy-cos(t(1:$-1)),%inf)
 
96
 ]]></programlisting>
 
97
    </refsection>
 
98
</refentry>