~ubuntu-branches/ubuntu/raring/scilab/raring-proposed

« back to all changes in this revision

Viewing changes to modules/m2sci/help/en_US/m2sci_equivalents/m/max.xml

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2012-08-30 14:42:38 UTC
  • mfrom: (1.4.7)
  • Revision ID: package-import@ubuntu.com-20120830144238-c1y2og7dbm7m9nig
Tags: 5.4.0-beta-3-1~exp1
* New upstream release
* Update the scirenderer dep
* Get ride of libjhdf5-java dependency

Show diffs side-by-side

added added

removed removed

Lines of Context:
11
11
 *
12
12
 -->
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">
14
 
  <refnamediv>
15
 
    <refname>max (Matlab function)</refname>
16
 
    <refpurpose>Maximum</refpurpose>
17
 
  </refnamediv>
18
 
  <refsection>
19
 
    <title>Matlab/Scilab equivalent</title>
20
 
    <informaltable border="1" width="100%">
21
 
      <tr>
22
 
        <td align="center">
23
 
          <emphasis role="bold">Matlab</emphasis>
24
 
        </td>
25
 
        <td align="center">
26
 
          <emphasis role="bold">Scilab</emphasis>
27
 
        </td>
28
 
      </tr>
29
 
      <tr>
30
 
        <td>
31
 
          <programlisting role="example"><![CDATA[
32
 
max
33
 
]]></programlisting>
34
 
        </td>
35
 
        <td>
36
 
          <programlisting role="example"><![CDATA[
37
 
max
38
 
]]></programlisting>
39
 
        </td>
40
 
      </tr>
41
 
    </informaltable>
42
 
  </refsection>
43
 
  <refsection>
44
 
    <title>Particular cases</title>
45
 
    <para>
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.
47
 
</para>
48
 
    <para>
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>).
50
 
</para>
51
 
    <variablelist>
52
 
      <varlistentry>
53
 
        <term>C=max(A)</term>
54
 
        <listitem>
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.
56
 
</para>
57
 
        </listitem>
58
 
      </varlistentry>
59
 
    </variablelist>
60
 
  </refsection>
61
 
  <refsection>
62
 
    <title>Examples</title>
63
 
    <informaltable border="1" width="100%">
64
 
      <tr>
65
 
        <td align="center">
66
 
          <emphasis role="bold">Matlab</emphasis>
67
 
        </td>
68
 
        <td align="center">
69
 
          <emphasis role="bold">Scilab</emphasis>
70
 
        </td>
71
 
      </tr>
72
 
      <tr>
73
 
        <td>
74
 
          <programlisting role="example"><![CDATA[
 
14
    <refnamediv>
 
15
        <refname>max (Matlab function)</refname>
 
16
        <refpurpose>Maximum</refpurpose>
 
17
    </refnamediv>
 
18
    <refsection>
 
19
        <title>Matlab/Scilab equivalent</title>
 
20
        <informaltable border="1" width="100%">
 
21
            <tr>
 
22
                <td align="center">
 
23
                    <emphasis role="bold">Matlab</emphasis>
 
24
                </td>
 
25
                <td align="center">
 
26
                    <emphasis role="bold">Scilab</emphasis>
 
27
                </td>
 
28
            </tr>
 
29
            <tr>
 
30
                <td>
 
31
                    <programlisting role="example"><![CDATA[
 
32
max
 
33
]]></programlisting>
 
34
                </td>
 
35
                <td>
 
36
                    <programlisting role="example"><![CDATA[
 
37
max
 
38
]]></programlisting>
 
39
                </td>
 
40
            </tr>
 
41
        </informaltable>
 
42
    </refsection>
 
43
    <refsection>
 
44
        <title>Particular cases</title>
 
45
        <para>
 
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.
 
47
        </para>
 
48
        <para>
 
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>).
 
50
        </para>
 
51
        <variablelist>
 
52
            <varlistentry>
 
53
                <term>C=max(A)</term>
 
54
                <listitem>
 
55
                    <para>
 
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.
 
57
                    </para>
 
58
                </listitem>
 
59
            </varlistentry>
 
60
        </variablelist>
 
61
    </refsection>
 
62
    <refsection>
 
63
        <title>Examples</title>
 
64
        <informaltable border="1" width="100%">
 
65
            <tr>
 
66
                <td align="center">
 
67
                    <emphasis role="bold">Matlab</emphasis>
 
68
                </td>
 
69
                <td align="center">
 
70
                    <emphasis role="bold">Scilab</emphasis>
 
71
                </td>
 
72
            </tr>
 
73
            <tr>
 
74
                <td>
 
75
                    <programlisting role="example"><![CDATA[
75
76
A = [1,2,3;4,5,6]
76
77
C = max(A)
77
78
C = [4,5,6]
81
82
C = max(A,B)
82
83
C = [7,8,9;4,5,6]
83
84
]]></programlisting>
84
 
        </td>
85
 
        <td>
86
 
          <programlisting role="example"><![CDATA[
 
85
                </td>
 
86
                <td>
 
87
                    <programlisting role="example"><![CDATA[
87
88
A = [1,2,3;4,5,6]
88
89
C = max(A)
89
90
C = 6
93
94
C = max(A,B)
94
95
C = [7,8,9;4,5,6]
95
96
]]></programlisting>
96
 
        </td>
97
 
      </tr>
98
 
    </informaltable>
99
 
  </refsection>
 
97
                </td>
 
98
            </tr>
 
99
        </informaltable>
 
100
    </refsection>
100
101
</refentry>