[doc] update and fix some warnings
[scilab.git] / scilab / modules / compatibility_functions / help / en_US / mtlb_s.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     *
15     -->
16 <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_s">
17     <refnamediv>
18         <refname>mtlb_s</refname>
19         <refpurpose>Matlab subtraction emulation function</refpurpose>
20     </refnamediv>
21     <refsection>
22         <title>Description</title>
23         <para>Matlab and Scilab subtraction behave differently in some particular cases:</para>
24         <itemizedlist>
25             <listitem>
26                 <para>
27                     With character string operands: The <literal>-</literal>
28                     operator can not be used into Scilab with character strings, while
29                     Matlab realizes the subtraction of the operands ASCII codes.
30                 </para>
31             </listitem>
32             <listitem>
33                 <para>
34                     With empty matrix: In Scilab, if one of the
35                     operands is an empty matrix the result of the subtraction is the
36                     other operand. In Matlab if one of the operand is an empty
37                     matrix the result of the subtraction should be an error or an empty
38                     matrix.
39                 </para>
40             </listitem>
41         </itemizedlist>
42         <para>
43             The function <literal>mtlb_s(A,B)</literal> is used by
44             <literal>mfile2sci</literal> to replace <literal>A-B</literal> when it was not
45             possible to know what were the operands while porting Matlab code to Scilab. This function will
46             determine the correct semantic at run time. If you want to have a
47             more efficient code it is possible to replace <literal>mtlb_s</literal> calls:
48         </para>
49         <itemizedlist>
50             <listitem>
51                 <para>
52                     If <literal>A</literal> and <literal>B</literal> are character strings,
53                     <literal>mtlb_s(A,B)</literal> may be replaced by <literal>asciimat(A)-asciimat(B)</literal>
54                 </para>
55             </listitem>
56             <listitem>
57                 <para>
58                     If both <literal>A</literal> and <literal>B</literal> are not empty matrices
59                     <literal>mtlb_s(A,B)</literal> may be replaced by <literal>A-B</literal>,
60                     else <literal>mtlb_s(A,B)</literal> may be replaced by
61                     <literal>[]</literal>.
62                 </para>
63             </listitem>
64         </itemizedlist>
65         <para>
66             <warning>
67                 Caution: <literal>mtlb_s</literal> has not to be used for hand coded functions.
68             </warning>
69         </para>
70     </refsection>
71     <refsection role="see also">
72         <title>See also</title>
73         <simplelist type="inline">
74             <member>
75                 <link linkend="mtlb_a">mtlb_a</link>
76             </member>
77         </simplelist>
78     </refsection>
79 </refentry>