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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" version="5.0-subset Scilab" xml:id="m2sci_max">
15
<refname>max (Matlab function)</refname>
16
<refpurpose>Maximum</refpurpose>
19
<title>Matlab/Scilab equivalent</title>
20
<informaltable border="1" width="100%">
23
<emphasis role="bold">Matlab</emphasis>
26
<emphasis role="bold">Scilab</emphasis>
31
<programlisting role="example"><![CDATA[
36
<programlisting role="example"><![CDATA[
44
<title>Particular cases</title>
46
Matlab <emphasis role="bold">max</emphasis> function can work with complexes, what Scilab <emphasis role="bold">max</emphasis> can not, so a emulation function called <emphasis role="bold">mtlb_max</emphasis> has been written.
49
Note that in Scilab, second input parameter can give the dimension to use to find the maximum values or another matrix (maximum of two matrices), in Matlab, dimension parameter is given in a third input parameter (in this case, second parameter must be <emphasis role="bold">[]</emphasis>).
55
<para>If <emphasis role="bold">A</emphasis> is a matrix, <emphasis role="bold">max(A)</emphasis> is equivalent to <emphasis role="bold">max(A,[],1)</emphasis> in Matlab whereas in Scilab <emphasis role="bold">max(A)</emphasis> gives the maximum value found in <emphasis role="bold">A</emphasis>. Matlab <emphasis role="bold">max</emphasis> treats the values along the first non-singleton dimension.
62
<title>Examples</title>
63
<informaltable border="1" width="100%">
66
<emphasis role="bold">Matlab</emphasis>
69
<emphasis role="bold">Scilab</emphasis>
74
<programlisting role="example"><![CDATA[
15
<refname>max (Matlab function)</refname>
16
<refpurpose>Maximum</refpurpose>
19
<title>Matlab/Scilab equivalent</title>
20
<informaltable border="1" width="100%">
23
<emphasis role="bold">Matlab</emphasis>
26
<emphasis role="bold">Scilab</emphasis>
31
<programlisting role="example"><![CDATA[
36
<programlisting role="example"><![CDATA[
44
<title>Particular cases</title>
46
Matlab <emphasis role="bold">max</emphasis> function can work with complexes, what Scilab <emphasis role="bold">max</emphasis> can not, so a emulation function called <emphasis role="bold">mtlb_max</emphasis> has been written.
49
Note that in Scilab, second input parameter can give the dimension to use to find the maximum values or another matrix (maximum of two matrices), in Matlab, dimension parameter is given in a third input parameter (in this case, second parameter must be <emphasis role="bold">[]</emphasis>).
56
If <emphasis role="bold">A</emphasis> is a matrix, <emphasis role="bold">max(A)</emphasis> is equivalent to <emphasis role="bold">max(A,[],1)</emphasis> in Matlab whereas in Scilab <emphasis role="bold">max(A)</emphasis> gives the maximum value found in <emphasis role="bold">A</emphasis>. Matlab <emphasis role="bold">max</emphasis> treats the values along the first non-singleton dimension.
63
<title>Examples</title>
64
<informaltable border="1" width="100%">
67
<emphasis role="bold">Matlab</emphasis>
70
<emphasis role="bold">Scilab</emphasis>
75
<programlisting role="example"><![CDATA[