<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
<MAN>
  <LANGUAGE>eng</LANGUAGE>
  <TITLE>maxi</TITLE>
  <TYPE>Scilab Function</TYPE>
  <DATE>April 1993</DATE>
  <SHORT_DESCRIPTION name="maxi"> maximum</SHORT_DESCRIPTION>
  <CALLING_SEQUENCE>
    <CALLING_SEQUENCE_ITEM>[m [,k]]=maxi(A)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[m [,k]]=maxi(A,'c')  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[m [,k]]=maxi(A,'r')  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[m [,k]]=maxi(A,'m')  </CALLING_SEQUENCE_ITEM>

    <CALLING_SEQUENCE_ITEM>[m [,k]]=maxi(A1,A2,...,An)  </CALLING_SEQUENCE_ITEM>
    <CALLING_SEQUENCE_ITEM>[m [,k]]=maxi(list(A1,A2,...,An))  </CALLING_SEQUENCE_ITEM>
  </CALLING_SEQUENCE>
  <PARAM>
    <PARAM_INDENT>
      <PARAM_ITEM>
        <PARAM_NAME>A</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: real vector or matrix.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
      <PARAM_ITEM>
        <PARAM_NAME>A1,...,An</PARAM_NAME>
        <PARAM_DESCRIPTION>
          <SP>: a set of real vectors or matrices, all of the same size or scalar.</SP>
        </PARAM_DESCRIPTION>
      </PARAM_ITEM>
    </PARAM_INDENT>
  </PARAM>
  <DESCRIPTION>
    <P> For <VERB>A</VERB>, a real  vector or matrix, <VERB>maxi(A)</VERB> is
      the largest element <VERB>A</VERB>. <VERB>[m,k]=maxi(A)</VERB> gives in
      addition the index of the maximum. A second argument of type string
      <VERB>'r'</VERB> or <VERB>'c'</VERB> can be used : <VERB>'r'</VERB> is
      used to get a row vector <VERB>m</VERB> such that <VERB>m(j)</VERB>
      contains the maximum of the <VERB>j</VERB> th column of A
      (<VERB>A(:,j)</VERB>), <VERB>k(j)</VERB> gives the row indice which
      contain the maximum for column <VERB>j</VERB>. <VERB>'c'</VERB> is used
      for the dual operation on the rows of <VERB>A</VERB>. <VERB>'m'</VERB> is used
      for compatibility with Matlab.</P>

    <P><VERB>m=maxi(A1,A2,...,An)</VERB>, where all the <VERB>Aj</VERB> are
      matrices of the same sizes,returns a vector or a matrix <VERB>m</VERB> of
      size <VERB>size(m)=size(A1)</VERB> such that <VERB>m(i)= maxi( Aj(i)),
	j=1,...,n</VERB>. <VERB>[m,k]=maxi(A1,A2,...,An)</VERB> gives in
      addition the vector or matrix <VERB>k</VERB>. for a fixed <VERB>i</VERB>,
      <VERB>k(i)</VERB> is the number of the first <VERB>Aj(i)</VERB> achieving
      the maximum.</P>

    <P><VERB>[m,k]=maxi(list(A1,...,An))</VERB> is an equivalent syntax of 
    <VERB>[m,k]=maxi(A1,A2,...,An)</VERB></P>

  </DESCRIPTION>
  <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))
 ]]>
  </EXAMPLE>
  <SEE_ALSO>
    <SEE_ALSO_ITEM>
      <LINK>sort</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>find</LINK>
    </SEE_ALSO_ITEM>
    <SEE_ALSO_ITEM>
      <LINK>mini</LINK>
    </SEE_ALSO_ITEM>
  </SEE_ALSO>
</MAN>
