Revision of help page for clean function.
[scilab.git] / scilab / modules / elementary_functions / help / en_US / floating_point / clean.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2006-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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="clean">
14     <refnamediv>
15         <refname>clean</refname>
16         <refpurpose> cleans matrices (round to zero small entries)    </refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>B=clean(A [,epsa [,epsr]])</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>A</term>
27                 <listitem>
28                     <para>a numerical matrix (scalar, polynomial, sparse, ...).</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>epsa, epsr</term>
33                 <listitem>
34                     <para>real numbers. Cleaning tolerances (default values resp. <literal>1.d-10</literal> and <literal>1.d-10</literal>).</para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             This function eliminates (i.e. set to zero) all the coefficients
43             with absolute value &lt; <varname>epsa</varname> or relative value &lt; <varname>epsr</varname>
44             (relative means relative w.r.t. <literal>1-norm</literal> of coefficients)
45             in a polynomial (possibly matrix polynomial or rational
46             matrix).
47         </para>
48         <para>
49             Default  values are <varname>epsa</varname><literal>=1.d-10</literal> and <varname>epsr</varname><literal>=1.d-10;</literal>
50         </para>
51         <para>
52             For a constant (non-polynomial) matrix <code>clean(A,epsa)</code> sets to zero all
53             entries of <literal>A</literal> smaller than <varname>epsa</varname>.
54         </para>
55     </refsection>
56     <refsection>
57         <title>Examples</title>
58         <programlisting role="example"><![CDATA[ 
59 x=poly(0,'x');
60 w=[x,1,2+x;3+x,2-x,x^2;1,2,3+x]/3;
61 w*inv(w)
62 clean(w*inv(w))
63  ]]></programlisting>
64     </refsection>
65 </refentry>