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

« back to all changes in this revision

Viewing changes to modules/elementary_functions/help/en_US/discrete/rat.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:
11
11
 *
12
12
 -->
13
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="rat" xml:lang="en">
14
 
  <refnamediv>
15
 
    <refname>rat</refname>
16
 
    <refpurpose>Floating point rational approximation</refpurpose>
17
 
  </refnamediv>
18
 
  <refsynopsisdiv>
19
 
    <title>Calling Sequence</title>
20
 
    <synopsis>[N,D]=rat(X [,tol])
21
 
      Y=rat(X [,tol])
22
 
    </synopsis>
23
 
  </refsynopsisdiv>
24
 
  <refsection>
25
 
    <title>Arguments</title>
26
 
    <variablelist>
27
 
      <varlistentry>
28
 
        <term>X</term>
29
 
        <listitem>
30
 
          <para>real vector or matrix</para>
31
 
        </listitem>
32
 
      </varlistentry>
33
 
      <varlistentry>
34
 
        <term>tol</term>
35
 
        <listitem>
36
 
          <para>real positive scalar, the tolerance (see below). Default value is 1d-6.</para>
37
 
        </listitem>
38
 
      </varlistentry>
39
 
      <varlistentry>
40
 
        <term>N</term>
41
 
        <listitem>
42
 
          <para>integer vector or matrix</para>
43
 
        </listitem>
44
 
      </varlistentry>
45
 
      <varlistentry>
46
 
        <term>D</term>
47
 
        <listitem>
48
 
          <para>integer vector or matrix</para>
49
 
        </listitem>
50
 
      </varlistentry>
51
 
      <varlistentry>
52
 
        <term>Y</term>
53
 
        <listitem>
54
 
          <para>real vector or matrix</para>
55
 
        </listitem>
56
 
      </varlistentry>
57
 
    </variablelist>
58
 
  </refsection>
59
 
  <refsection>
60
 
    <title>Description</title>
61
 
    <para>
62
 
      <literal>[N,D] = rat(X,tol)</literal> returns two integer matrices
63
 
      so that <literal>N./D</literal> is close to<literal>X</literal> in the
64
 
      sense that <literal>abs(N./D - X) &lt;= tol*norm(X,1)*abs(X)</literal>. 
65
 
    </para>
66
 
    <para>
67
 
      <literal>y=rat(x,tol)</literal> return the quotient
68
 
      <literal>N./D</literal>
69
 
    </para>
70
 
    <para>
71
 
      The rational approximations are generated by truncating
72
 
      continued fraction expansions. 
73
 
    </para>
74
 
  </refsection>
75
 
  <refsection>
76
 
    <title>Examples</title>
77
 
    <programlisting role="example"><![CDATA[ 
 
14
    <refnamediv>
 
15
        <refname>rat</refname>
 
16
        <refpurpose>Floating point rational approximation</refpurpose>
 
17
    </refnamediv>
 
18
    <refsynopsisdiv>
 
19
        <title>Calling Sequence</title>
 
20
        <synopsis>[N,D]=rat(X [,tol])
 
21
            Y=rat(X [,tol])
 
22
        </synopsis>
 
23
    </refsynopsisdiv>
 
24
    <refsection>
 
25
        <title>Arguments</title>
 
26
        <variablelist>
 
27
            <varlistentry>
 
28
                <term>X</term>
 
29
                <listitem>
 
30
                    <para>real vector or matrix</para>
 
31
                </listitem>
 
32
            </varlistentry>
 
33
            <varlistentry>
 
34
                <term>tol</term>
 
35
                <listitem>
 
36
                    <para>real positive scalar, the tolerance (see below). Default value is 1d-6.</para>
 
37
                </listitem>
 
38
            </varlistentry>
 
39
            <varlistentry>
 
40
                <term>N</term>
 
41
                <listitem>
 
42
                    <para>integer vector or matrix</para>
 
43
                </listitem>
 
44
            </varlistentry>
 
45
            <varlistentry>
 
46
                <term>D</term>
 
47
                <listitem>
 
48
                    <para>integer vector or matrix</para>
 
49
                </listitem>
 
50
            </varlistentry>
 
51
            <varlistentry>
 
52
                <term>Y</term>
 
53
                <listitem>
 
54
                    <para>real vector or matrix</para>
 
55
                </listitem>
 
56
            </varlistentry>
 
57
        </variablelist>
 
58
    </refsection>
 
59
    <refsection>
 
60
        <title>Description</title>
 
61
        <para>
 
62
            <literal>[N,D] = rat(X,tol)</literal> returns two integer matrices
 
63
            so that <literal>N./D</literal> is close to<literal>X</literal> in the
 
64
            sense that <literal>abs(N./D - X) &lt;= tol*norm(X,1)*abs(X)</literal>. 
 
65
        </para>
 
66
        <para>
 
67
            <literal>y=rat(x,tol)</literal> return the quotient
 
68
            <literal>N./D</literal>
 
69
        </para>
 
70
        <para>
 
71
            The rational approximations are generated by truncating
 
72
            continued fraction expansions. 
 
73
        </para>
 
74
    </refsection>
 
75
    <refsection>
 
76
        <title>Examples</title>
 
77
        <programlisting role="example"><![CDATA[ 
78
78
[n,d]=rat([3.5, 1.333333,-0.8])
79
79
[n,d]=rat(%pi)
80
80
[n,d]=rat(%pi,1.d-12)
81
81
n/d-%pi
82
82
 ]]></programlisting>
83
 
  </refsection>
84
 
  <refsection role="see also">
85
 
    <title>See Also</title>
86
 
    <simplelist type="inline">
87
 
      <member>
88
 
        <link linkend="int">int</link>
89
 
      </member>
90
 
      <member>
91
 
        <link linkend="round">round</link>
92
 
      </member>
93
 
    </simplelist>
94
 
  </refsection>
 
83
    </refsection>
 
84
    <refsection role="see also">
 
85
        <title>See Also</title>
 
86
        <simplelist type="inline">
 
87
            <member>
 
88
                <link linkend="int">int</link>
 
89
            </member>
 
90
            <member>
 
91
                <link linkend="round">round</link>
 
92
            </member>
 
93
        </simplelist>
 
94
    </refsection>
95
95
</refentry>