* Bug #8667 fixed - Handling of %nan in functions min,max,median is not correctly...
[scilab.git] / scilab / modules / elementary_functions / help / en_US / matrixoperations / min.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) 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" xmlns:scilab="http://www.scilab.org" xml:id="min" xml:lang="en">
14     <refnamediv>
15         <refname>min</refname>
16         <refpurpose>minimum</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>[m [,k]]=min(A)
21             [m [,k]]=min(A,'c')
22             [m [,k]]=min(A,'r')
23             [m [,k]]=min(A,'m')
24             [m [,k]]=min(A1,A2,...,An)
25             [m [,k]]=min(list(A1,A2,...,An))
26         </synopsis>
27     </refsynopsisdiv>
28     <refsection>
29         <title>Arguments</title>
30         <variablelist>
31             <varlistentry>
32                 <term>A</term>
33                 <listitem>
34                     <para>real vector or matrix.</para>
35                 </listitem>
36             </varlistentry>
37             <varlistentry>
38                 <term>A1,...,An</term>
39                 <listitem>
40                     <para>a set of real vectors or matrices, all of the same size or
41                         scalar.
42                     </para>
43                 </listitem>
44             </varlistentry>
45         </variablelist>
46     </refsection>
47     <refsection>
48         <title>Description</title>
49         <para>
50             For <literal>A</literal>, a real vector or matrix,
51             <literal>min(A)</literal> is the least element <literal>A</literal>.
52             <literal>[m,k]=min(A)</literal> gives in addition the index of the
53             minimum. A second argument of type string <literal>'r'</literal> or
54             <literal>'c'</literal> can be used : <literal>'r'</literal> is used to get
55             a row vector <literal>m</literal> such that <literal>m(j)</literal>
56             contains the minimum of the <literal>j</literal>th column of <literal>A</literal>
57             (<literal>A(:,j)</literal>), <literal>k(j)</literal> gives the row indice
58             which contain the minimum for column <literal>j</literal>.
59             <literal>'c'</literal> is used for the dual operation on the rows of
60             <literal>A</literal>. <literal>'m'</literal> is used for compatibility
61             with Matlab.
62         </para>
63         <para>
64             <literal>m=min(A1,A2,...,An)</literal>, where all the
65             <literal>Aj</literal> are matrices of the same sizes, returns a vector or a
66             matrix <literal>m</literal> of size <literal>size(m)=size(A1)</literal>
67             such that <literal>m(i)= min( Aj(i)), j=1,...,n</literal>.
68             <literal>[m,k]=min(A1,A2,...,An)</literal> gives in addition the vector or
69             matrix <literal>k</literal>. For a fixed <literal>i</literal>,
70             <literal>k(i)</literal> is the number of the first
71             <literal>Aj(i)</literal> achieving the minimum.
72         </para>
73         <para>
74             <literal>[m,k]=min(list(A1,...,An))</literal> is an equivalent
75             syntax of <literal>[m,k]=min(A1,A2,...,An)</literal>.
76         </para>
77     </refsection>
78     <refsection>
79         <title>Remark</title>
80         <para>
81             <note>
82                 This function ignores terms of <varname>A</varname> which are NANs.
83             </note>
84         </para>
85     </refsection>
86     <refsection>
87         <title>Examples</title>
88         <programlisting role="example"><![CDATA[ 
89 [m,n]=min([1,3,1])
90 [m,n]=min([3,1,1],[1,3,1],[1,1,3])
91 [m,n]=min([3,-2,1],1)
92 [m,n]=min(list([3,1,1],[1,3,1],[1,1,3]))
93 [m,n]=min(list(1,3,1))
94  ]]></programlisting>
95     </refsection>
96     <refsection role="see also">
97         <title>See Also</title>
98         <simplelist type="inline">
99             <member>
100                 <link linkend="gsort">gsort</link>
101             </member>
102             <member>
103                 <link linkend="find">find</link>
104             </member>
105             <member>
106                 <link linkend="max">max</link>
107             </member>
108         </simplelist>
109     </refsection>
110 </refentry>