1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116
|
<?xml version="1.0" encoding="UTF-8"?>
<!--
* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
* Copyright (C) 2008 - INRIA
*
* This file must be used under the terms of the CeCILL.
* This source file is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
* are also available at
* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
*
-->
<refentry version="5.0-subset Scilab" xml:id="maxi" xml:lang="en"
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">
<info>
<pubdate>$LastChangedDate$</pubdate>
</info>
<refnamediv>
<refname>maxi</refname>
<refpurpose>maximum</refpurpose>
</refnamediv>
<refsynopsisdiv>
<title>Calling Sequence</title>
<synopsis>[m [,k]]=maxi(A)
[m [,k]]=maxi(A,'c')
[m [,k]]=maxi(A,'r')
[m [,k]]=maxi(A,'m')
[m [,k]]=maxi(A1,A2,...,An)
[m [,k]]=maxi(list(A1,A2,...,An))</synopsis>
</refsynopsisdiv>
<refsection>
<title>Parameters</title>
<variablelist>
<varlistentry>
<term>A</term>
<listitem>
<para>real vector or matrix.</para>
</listitem>
</varlistentry>
<varlistentry>
<term>A1,...,An</term>
<listitem>
<para>a set of real vectors or matrices, all of the same size or
scalar.</para>
</listitem>
</varlistentry>
</variablelist>
</refsection>
<refsection>
<title>Description</title>
<para>For <literal>A</literal>, a real vector or matrix,
<literal>maxi(A)</literal> is the largest element <literal>A</literal>.
<literal>[m,k]=maxi(A)</literal> gives in addition the index of the
maximum. A second argument of type string <literal>'r'</literal> or
<literal>'c'</literal> can be used : <literal>'r'</literal> is used to get
a row vector <literal>m</literal> such that <literal>m(j)</literal>
contains the maximum of the <literal>j</literal> th column of A
(<literal>A(:,j)</literal>), <literal>k(j)</literal> gives the row indice
which contain the maximum for column <literal>j</literal>.
<literal>'c'</literal> is used for the dual operation on the rows of
<literal>A</literal>. <literal>'m'</literal> is used for compatibility
with Matlab.</para>
<para><literal>m=maxi(A1,A2,...,An)</literal>, where all the
<literal>Aj</literal> are matrices of the same sizes,returns a vector or a
matrix <literal>m</literal> of size <literal>size(m)=size(A1)</literal>
such that <literal>m(i)= maxi( Aj(i)), j=1,...,n</literal>.
<literal>[m,k]=maxi(A1,A2,...,An)</literal> gives in addition the vector
or matrix <literal>k</literal>. for a fixed <literal>i</literal>,
<literal>k(i)</literal> is the number of the first
<literal>Aj(i)</literal> achieving the maximum.</para>
<para><literal>[m,k]=maxi(list(A1,...,An))</literal> is an equivalent
syntax of <literal>[m,k]=maxi(A1,A2,...,An)</literal></para>
</refsection>
<refsection>
<title>Examples</title>
<programlisting role="example"><![CDATA[
[m,n]=maxi([1,3,1])
[m,n]=maxi([3,1,1],[1,3,1],[1,1,3])
[m,n]=maxi([3,-2,1],1)
[m,n]=maxi(list([3,1,1],[1,3,1],[1,1,3]))
[m,n]=maxi(list(1,3,1))
]]></programlisting>
</refsection>
<refsection>
<title>See Also</title>
<simplelist type="inline">
<member><link linkend="gsort">gsort</link></member>
<member><link linkend="find">find</link></member>
<member><link linkend="mini">mini</link></member>
</simplelist>
</refsection>
</refentry>
|