GPL + CeCILL Header change
[scilab.git] / scilab / modules / compatibility_functions / help / en_US / mtlb_e.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) 2004-2007 - INRIA - Vincent COUVERT 
5     * 
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  * === LICENSE_END ===
15     *
16     -->
17 <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" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="mtlb_e">
18     <refnamediv>
19         <refname>mtlb_e</refname>
20         <refpurpose>Matlab extraction emulation function</refpurpose>
21     </refnamediv>
22     <refsection>
23         <title>Description</title>
24         <para>Matlab and Scilab extraction behave differently in some particular cases:</para>
25         <itemizedlist>
26             <listitem>
27                 <para>
28                     When extracting data from a matrix with a vector as index: Matlab returns
29                     a row vector and Scilab returns a column vector.
30                 </para>
31             </listitem>
32             <listitem>
33                 <para>
34                     When extracting data from a character string matrix: due to the fact that character string matrices
35                     in Matlab can be addressed as any other matrix (each character can be adressed), extraction in such a type of
36                     matrix does not differ from other. But in Scilab it can't be done so and <literal>part</literal>
37                     function has to be used. 
38                 </para>
39             </listitem>
40         </itemizedlist>
41         <para>
42             The function <literal>mtlb_e(B,k)</literal> is used by
43             <literal>mfile2sci</literal> to replace <literal>A=B(k)</literal> when it was not
44             possible to know what were the operands while porting Matlab code to Scilab. This function will
45             determine the correct semantic at run time. If you want to have a
46             more efficient code it is possible to replace <literal>mtlb_e</literal> calls:
47         </para>
48         <itemizedlist>
49             <listitem>
50                 <para>    
51                     If <literal>B</literal> is a vector
52                     <literal>A=mtlb_e(B,k)</literal> may be replaced by <literal>A=B(k)</literal>
53                 </para>
54             </listitem>
55             <listitem>
56                 <para>    
57                     If <literal>B</literal> is a matrix
58                     <literal>A=mtlb_e(B,k)</literal> may be replaced by <literal>A=B(k).'</literal>
59                 </para>
60             </listitem>
61             <listitem>
62                 <para>    
63                     If <literal>B</literal> is a character string matrix and
64                     k is a scalar or a vector
65                     <literal>A=mtlb_e(B,k)</literal> may be replaced by <literal>A=part(B,k)</literal>
66                 </para>
67             </listitem>
68         </itemizedlist>
69         <para>
70             <warning>
71                 Caution: <literal>mtlb_e</literal> has not to be used for hand coded functions.
72             </warning>
73         </para>
74     </refsection>
75     <refsection role="see also">
76         <title>See Also</title>
77         <simplelist type="inline">
78             <member>
79                 <link linkend="MatlabScilab_character_strings">Matlab-Scilab_character_strings</link>
80             </member>
81             <member>
82                 <link linkend="part">part</link>
83             </member>
84         </simplelist>
85     </refsection>
86 </refentry>