Also update the URL to the CeCILL license. Thanks to Paul for noticing that
[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     * This file must be used under the terms of the CeCILL.
7     * This source file is licensed as described in the file COPYING, which
8     * you should have received as part of this distribution.  The terms
9     * are also available at    
10     * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11     *
12     -->
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" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="mtlb_e">
14     <refnamediv>
15         <refname>mtlb_e</refname>
16         <refpurpose>Matlab extraction emulation function</refpurpose>
17     </refnamediv>
18     <refsection>
19         <title>Description</title>
20         <para>Matlab and Scilab extraction behave differently in some particular cases:</para>
21         <itemizedlist>
22             <listitem>
23                 <para>
24                     When extracting data from a matrix with a vector as index: Matlab returns
25                     a row vector and Scilab returns a column vector.
26                 </para>
27             </listitem>
28             <listitem>
29                 <para>
30                     When extracting data from a character string matrix: due to the fact that character string matrices
31                     in Matlab can be addressed as any other matrix (each character can be adressed), extraction in such a type of
32                     matrix does not differ from other. But in Scilab it can't be done so and <literal>part</literal>
33                     function has to be used. 
34                 </para>
35             </listitem>
36         </itemizedlist>
37         <para>
38             The function <literal>mtlb_e(B,k)</literal> is used by
39             <literal>mfile2sci</literal> to replace <literal>A=B(k)</literal> when it was not
40             possible to know what were the operands while porting Matlab code to Scilab. This function will
41             determine the correct semantic at run time. If you want to have a
42             more efficient code it is possible to replace <literal>mtlb_e</literal> calls:
43         </para>
44         <itemizedlist>
45             <listitem>
46                 <para>    
47                     If <literal>B</literal> is a vector
48                     <literal>A=mtlb_e(B,k)</literal> may be replaced by <literal>A=B(k)</literal>
49                 </para>
50             </listitem>
51             <listitem>
52                 <para>    
53                     If <literal>B</literal> is a matrix
54                     <literal>A=mtlb_e(B,k)</literal> may be replaced by <literal>A=B(k).'</literal>
55                 </para>
56             </listitem>
57             <listitem>
58                 <para>    
59                     If <literal>B</literal> is a character string matrix and
60                     k is a scalar or a vector
61                     <literal>A=mtlb_e(B,k)</literal> may be replaced by <literal>A=part(B,k)</literal>
62                 </para>
63             </listitem>
64         </itemizedlist>
65         <para>
66             Caution: <literal>mtlb_e</literal> has not to be used for hand coded functions.
67         </para>
68     </refsection>
69     <refsection role="see also">
70         <title>See Also</title>
71         <simplelist type="inline">
72             <member>
73                 <link linkend="MatlabScilab_character_strings">Matlab-Scilab_character_strings</link>
74             </member>
75             <member>
76                 <link linkend="part">part</link>
77             </member>
78         </simplelist>
79     </refsection>
80 </refentry>