* Bug 15431 fixed [doc]: empty [] better documented 26/20926/8
Samuel GOUGEON [Sat, 6 Apr 2019 07:01:02 +0000 (09:01 +0200)]
  http://bugzilla.scilab.org/15431
  New empty page (PDF): http://bugzilla.scilab.org/attachment.cgi?id=4929

Change-Id: Ife267433b3f157cbcdcb58e737a358a01c8ba6f6

21 files changed:
scilab/CHANGES.md
scilab/modules/elementary_functions/help/en_US/elementarymatrices/empty.xml
scilab/modules/elementary_functions/help/fr_FR/elementarymatrices/empty.xml [deleted file]
scilab/modules/elementary_functions/help/ja_JP/elementarymatrices/empty.xml [deleted file]
scilab/modules/elementary_functions/help/pt_BR/elementarymatrices/empty.xml [deleted file]
scilab/modules/elementary_functions/help/ru_RU/elementarymatrices/empty.xml
scilab/modules/integer/help/en_US/iconvert.xml
scilab/modules/integer/help/en_US/int8.xml
scilab/modules/integer/help/fr_FR/iconvert.xml
scilab/modules/integer/help/fr_FR/int8.xml
scilab/modules/integer/help/ja_JP/iconvert.xml
scilab/modules/integer/help/ja_JP/int8.xml
scilab/modules/integer/help/pt_BR/iconvert.xml
scilab/modules/integer/help/pt_BR/int8.xml
scilab/modules/integer/help/ru_RU/iconvert.xml
scilab/modules/integer/help/ru_RU/int8.xml
scilab/modules/string/help/en_US/string.xml
scilab/modules/string/help/fr_FR/string.xml
scilab/modules/string/help/ja_JP/string.xml
scilab/modules/string/help/pt_BR/string.xml
scilab/modules/string/help/ru_RU/string.xml

index 3980554..63afa35 100644 (file)
@@ -242,11 +242,11 @@ Bug Fixes
 * [#15392](http://bugzilla.scilab.org/show_bug.cgi?id=15392): `comet` and `comet3d` did not allow specifying colors with colors names.
 * [#15393](http://bugzilla.scilab.org/show_bug.cgi?id=15393): In a new figure, `nicholschart` plotted nothing. The default frame color was a flashy cyan. The position of gain labels could be puzzling. It was not possible to specify colors by their names. Postprocessing the frames and the set of labels was not easy.
 * [#15425](http://bugzilla.scilab.org/show_bug.cgi?id=15425): The Kronecker product `a.*.b` failed when `a` or `b` or both are hypermatrices, with one or both being polynomials or rationals.
+* [#15431](http://bugzilla.scilab.org/show_bug.cgi?id=15431): The empty matrix `[]` and its non-convertibility were poorly documented.
 * [#15451](http://bugzilla.scilab.org/show_bug.cgi?id=15451): The code was not adapted to use `lucene 4.10` in Debian.
 * [#15514](http://bugzilla.scilab.org/show_bug.cgi?id=15514): The `set()` documentation page needed to be overhauled.
 * [#15522](http://bugzilla.scilab.org/show_bug.cgi?id=15522): `unique()` was not able to consider all Nan values as the same value. A `uniqueNan` option now allows it.
 * [#15523](http://bugzilla.scilab.org/show_bug.cgi?id=15523): `%ODEOPTIONS(1)=2` didn't work with solvers 'rk' and 'rkf'
-* [#15248](http://bugzilla.scilab.org/show_bug.cgi?id=15248): `lsq()`was leaking memory.
 * [#15577](http://bugzilla.scilab.org/show_bug.cgi?id=15577): `edit` did not accept a line number as text, as with `edit linspace 21`.
 * [#15580](http://bugzilla.scilab.org/show_bug.cgi?id=15580): `det(sparse([],[]))` yielded an error.
 * [#15595](http://bugzilla.scilab.org/show_bug.cgi?id=15595): `unique()` was not able to return distinct values in their original order, without sorting them. A `keepOrder` option now allows it.
index aef00a5..88711dc 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
 <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="empty">
     <refnamediv>
-        <refname>empty</refname>
-        <refpurpose>([]) empty matrix</refpurpose>
+        <refname>empty []</refname>
+        <refpurpose>empty matrix. Array ranges destructor.</refpurpose>
     </refnamediv>
     <refsection>
+        <title>Contents</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="empty_general_properties">General [ ] properties</link>
+            </member>
+            <member>
+                <link linkend="empty_operand_or_argument">[ ] as operand or input argument</link>
+            </member>
+            <member>
+                <link linkend="empty_assigned_as_destructor">[ ] assigned as ranges destructor</link>
+            </member>
+            <member>
+                <link linkend="empty_examples">Examples</link>
+            </member>
+            <member>
+                <link linkend="empty_seealso">See also</link>
+            </member>
+            <member>
+                <link linkend="empty_history">History</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
         <title>Description</title>
+        <refsect3 id="empty_general_properties">
+            <title>General [ ] properties</title>
+            <para>
+            Empty brackets <literal>[]</literal> represent the empty matrix. Its general properties
+            are now described.
+            </para>
+            <orderedlist>
+                <listitem>
+                    <para>
+                    It has only two dimensions. Any dimension > #2 is automatically squeezed:
+                    <screen><![CDATA[
+--> e = ones(1,2,0,2); size(e)
+ ans  =
+   0.   0.
+
+--> e == []
+ ans  =
+  T
+]]></screen>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    It is always of real decimal type. There is no empty matrix of integer types
+                    (int8, uint8, int16, uint16, int32, uint32, int64, uint64), nor of string type,
+                    etc:
+                    <screen><![CDATA[
+--> type(uint8([]))  // not of type 8 (encoded integers)
+ ans  =
+   1.
+
+--> a = [1 2 ; 3 4] + %i;
+--> a(1,:) = []
+ a  =
+   3. + i     4. + i
+
+--> a(1,:) = [], isreal(a)
+ a  =
+    []
+ ans  =
+  T
+
+--> t = "abcd efg", type(t)
+ t  =
+ abcd efg
+
+ ans  =
+   10.
+
+--> t(1) = [], type(t)
+ t  =
+    []
+
+ ans  =
+   1.
+]]></screen>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    However, it is distinct from the sparse empty matrix:
+                    <screen><![CDATA[
+--> se = sparse([])
+ se  =
+(  0,  0) zero sparse matrix
+
+--> size(se)
+ ans  =
+   0.   0.
+
+--> se == []
+ ans  =
+  F
+]]></screen>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    It is also distinct from all empty heterogeneous containers
+                    <literal>list()</literal>, <literal>struct()</literal> or
+                    <literal>cell()</literal> :
+                    <screen><![CDATA[
+--> L = list()
+ L  =
+     ()
+--> L == []
+ ans  =
+  F
+
+--> s = struct()
+ s  =
+0x0 struct array with no fields.
+--> s == []
+ ans  =
+  F
+
+--> c = cell()
+ c  =
+   {}
+--> c == []
+ ans  =
+  F
+]]></screen>
+                    </para>
+                </listitem>
+            </orderedlist>
+        </refsect3>
+        <refsect3 id="empty_operand_or_argument">
+            <title>[ ] as operand or input argument</title>
+            <orderedlist>
+                <listitem>
+                    <para>
+                    As operand of usual predefined non-boolean operators, [] sets the result to [].
+                    <emphasis>All the following operations yield</emphasis> []:
+                    <table>
+                        <tr><td colspan="2"><emphasis role="bold">Unary operators</emphasis></td></tr>
+                        <tr><td colspan="2">[]', [].', -[],  ~[]</td></tr>
+                        <tr><td></td><td></td></tr>
+                        <tr><td colspan="2"><emphasis role="bold">Binary numerical operators</emphasis></td></tr>
+                        <tr><td>addition:</td>      <td> [] + [1 2], [1 2] + []</td></tr>
+                        <tr><td>subtraction:</td>   <td> [] - [1 2], [1 2] - []</td></tr>
+                        <tr><td>division:</td>      <td> []/[1 2], []./[1 2], [1 2]/[], [1 2]./[]</td></tr>
+                        <tr><td>left division:</td> <td> []\[1 2], [].\[1 2], [1 2]\[], [1 2].\[]</td></tr>
+                        <tr><td>multiplication:</td><td> []*[1 2], [].*[1 2], [1 2]*[], [1 2].*[]</td></tr>
+                        <tr><td>kronecker:</td>     <td> [].*.[1 2], [1 2].*.[]</td></tr>
+                        <tr><td>power:</td>         <td> []^[1 2], [].^[1 2], [1 2]^[], [1 2].^[]</td></tr>
+                        <tr><td></td><td></td></tr>
+                        <tr><td colspan="2"><emphasis role="bold">Inequality comparisons</emphasis></td></tr>
+                        <tr><td>greater:</td><td> []>[1 2], []>=[1 2], [1 2]>[], [1 2]>=[]</td></tr>
+                        <tr><td>less:</td><td> []&lt;[1 2], []&lt;=[1 2], [1 2]&lt;[], [1 2]&lt;=[]</td></tr>
+                    </table>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    As operand of boolean binary operators, [] <emphasis>is equivalent to %T</emphasis>:
+                    <table>
+                        <tr><td colspan="4"><emphasis role="bold">Binary numerical operators</emphasis></td></tr>
+                        <tr><td>or:</td> <td> [] | [%T %F], [%T %F] | []        </td><td>→</td><td>[%T %T]</td></tr>
+                        <tr><td>and:</td><td> [] &amp; [%T %F], [%T %F] &amp; []</td><td>→</td><td>[%T %F]</td></tr>
+                    </table>
+                    </para>
+                    But, noticeably:
+                    <itemizedlist>
+                        <listitem>
+                            <para>
+                                <literal>or([])</literal> is %F.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                As the condition of any <literal>if</literal> or <literal>while</literal>
+                                statement, [] is %F:
+                                <screen><![CDATA[
+--> if []
+-->     r = "[] is %T as any if condition";
+--> else
+-->     r = "[] is %F as any if condition";
+--> end
+--> r
+ r  =
+ [] is %F as any if condition
+]]></screen>
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+                <listitem>
+                    <para>
+                    In concatenations, [] is simply ignored:
+                    <literal>[A,[]] == [[],A] == [A ; []] == [[] ; A] == A</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    In text concatenations, +[] yields []:
+                    <literal>[]+["a" "bc"] == ["a" "bc"]+[] == []</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                        As special input matrix of linear algebra or common functions, the answer
+                        depends on the considered function. It is documented in the page dedicated
+                        to each function. Examples:
+                    </para>
+                    <para>
+                    <table>
+                    <tr>
+                    <td>
+                    <table>
+                        <tr><td><literal>det([])</literal></td>     <td><literal>1</literal></td></tr>
+                        <tr><td><literal>rank([])</literal></td>    <td><literal>0</literal></td></tr>
+                        <tr><td><literal>trace([])</literal></td>   <td><literal>0</literal></td></tr>
+                        <tr><td><literal>norm([])</literal></td>    <td><literal>0</literal></td></tr>
+                        <tr><td><literal>cond([])</literal></td>    <td><literal>0</literal></td></tr>
+                        <tr><td><literal>rcond([])</literal></td>   <td><literal>Inf</literal></td></tr>
+                    </table>
+                    </td>
+                    <td></td>
+                    <td>
+                    <table>
+                        <tr><td><literal>diag([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>tril([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>triu([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>min([])</literal></td>     <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>max([])</literal></td>     <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>sign([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>clean([])</literal></td>   <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>svd([])</literal></td>     <td><literal>[]</literal></td></tr>
+                    </table>
+                    </td>
+                    <td></td>
+                    <td>
+                    <table>
+                        <tr><td><literal>sum([])</literal></td>     <td><literal>0</literal></td></tr>
+                        <tr><td><literal>prod([])</literal></td>    <td><literal>1</literal></td></tr>
+                        <tr><td><literal>mean([])</literal></td>    <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>median([])</literal></td>  <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>stdev([])</literal></td>   <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>mad([])</literal></td>     <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>variance([])</literal></td><td><literal>Nan</literal></td></tr>
+                    </table>
+                    </td>
+                    </tr>
+                    </table>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                        As general input argument of functions, [] is often used to choose the default
+                        value of an input argument (to somewhat skip it, to avoid providing an actual
+                        explicit value). However, this is not a strict rule.
+                    </para>
+                </listitem>
+                <!--
+                <listitem>
+                    <para>
+                        Empty linear systems (<literal> syslin</literal> lists) may have several
+                        rows or columns.
+                        w=ssrand(2,2,2);
+                        wr=[]*w;
+                        size(wr), w1=ss2tf(wr), size(w1)
+                    </para>
+                </listitem>
+                -->
+            </orderedlist>
+        </refsect3>
+        <refsect3 id="empty_assigned_as_destructor">
+            <title>Assigning [ ] to delete ranges in arrays</title>
+        </refsect3>
         <para>
-            <literal> [] </literal> denotes the empty matrix. It is uniquely defined
-            and has 0 row and 0 column, i.e. <literal> size([]) =[0,0] </literal>.
-            The following convenient conventions are made:
-        </para>
-        <para>
-            <literal> [] * A = A * [] = [] </literal>
+            Considering an array of any number of dimensions and of any size, that can be a matrix
+            or hypermatrix of any datatype, an array of structures, or an array of cells, []
+            can be assigned to delete the addressed ranges (rows, columns, etc). These ones must
+            cover the full size of the array at least along one of its dimensions.
         </para>
+        <para>Examples:</para>
+        <para>With a matrix of decimal numbers:</para>
+        <programlisting role="example"><![CDATA[
+a = grand(3,5,"uin",0,9)
+     ]]></programlisting>
+        <screen><![CDATA[
+--> a = grand(3,5,"uin",0,9)
+ a  =
+   2.   4.   8.   0.   9.
+   2.   1.   3.   6.   4.
+   4.   9.   5.   9.   7.
+
+--> a(:,[3 5]) = []
+ a  =
+   2.   4.   0.
+   2.   1.   6.
+   4.   9.   9.
+
+--> a(2,:) = []
+ a  =
+   2.   4.   0.
+   4.   9.   9.
+]]></screen>
         <para>
-            <literal> [] + A = A + [] = [] </literal>
+            With an hypermatrix of texts:
         </para>
+        <programlisting role="example"><![CDATA[
+cs = cumsum(grand(2,4,3,"uin",1,3));
+t = matrix(strsplit(ascii(grand(1,cs($),"uin",ascii("a"),ascii("c"))),cs(1:$-1)),2,4,3)
+     ]]></programlisting>
+        <screen><![CDATA[
+--> cs = cumsum(grand(2,4,3,"uin",1,3));
+--> t = matrix(strsplit(ascii(grand(1,cs($),"uin",ascii("a"),ascii("c"))),cs(1:$-1)),2,4,3)
+ t  =
+(:,:,1)
+!ccc  b    b   b  !
+!bbb  bcc  bc  c  !
+
+(:,:,2)
+!aa  aab  bc  a   !
+!ab  a    cc  ba  !
+
+(:,:,3)
+!c   aba  c    abb  !
+!bc  cc   acb  c    !
+
+--> t(:,3,:) = []  // Deleting all 3rd columns
+ t  =
+(:,:,1)
+!ccc  b    b  !
+!bbb  bcc  c  !
+
+(:,:,2)
+!aa  aab  a   !
+!ab  a    ba  !
+
+(:,:,3)
+!c   aba  abb  !
+!bc  cc   c    !
+
+--> t(:,:,2) = []   // Deleting the 2nd page
+ t  =
+(:,:,1)
+!ccc  b    b  !
+!bbb  bcc  c  !
+
+(:,:,2)
+!c   aba  abb  !
+!bc  cc   c    !
+]]></screen>
         <para>
-            <literal> [ [], A] = [A, []] = A </literal>
+            With an array of cells:
         </para>
+        <programlisting role="example"><![CDATA[
+c = cat(3, {"start", -1.23, %f  ; (1-%s)^2, gda(), list(2,,%z)}, ..
+           {%t     , "abc", 5.2 ; int8(21), []   , %z})
+     ]]></programlisting>
+        <screen><![CDATA[
+--> c = cat(3, {"start", -1.23, %f  ; (1-%s)^2, gda(), list(2,,%z)}, ..
+               {%t     , "abc", 5.2 ; int8(21), []   , %z})
+ c  =
+(:,:,1)
+  [1x1 string    ]  [1x1 constant]  [1x1 boolean]
+  [1x1 polynomial]  [1x1 handle  ]  [    list   ]
+
+(:,:,2)
+  [1x1 boolean]  [1x1 string  ]  [1x1 constant  ]
+  [1x1 int8   ]  [0x0 constant]  [1x1 polynomial]
+
+--> c(:,2,:) = []                   // Deleting all 2nd columns
+ c  =
+(:,:,1)
+  [1x1 string    ]  [1x1 boolean]
+  [1x1 polynomial]  [    list   ]
+
+(:,:,2)
+  [1x1 boolean]  [1x1 constant  ]
+  [1x1 int8   ]  [1x1 polynomial]
+
+--> c(1,:,:) = []                   // Deleting all 1st rows
+ c  =
+(:,:,1)
+  [1x1 polynomial]  [ list]
+
+(:,:,2)
+  [1x1 int8]  [1x1 polynomial]
+]]></screen>
         <para>
-            Matrix functions return <literal>[]</literal> or an error message
-            when there is no obvious answer. Empty linear systems
-            (<literal> syslin</literal> lists) may have several rows or columns.
+            With an array of structures:
         </para>
+        <screen><![CDATA[
+--> s(4,5).r = %pi;
+--> s.b = %t
+ s  =
+4x5 struct array with fields:
+   r
+   b
+
+--> s([1 3],:) = []
+ s  =
+2x5 struct array with fields:
+   r
+   b
+
+--> s(:,2) = []
+ s  =
+2x4 struct array with fields:
+   r
+   b
+]]></screen>
     </refsection>
-    <refsection>
-        <title>Examples</title>
+    <refsection id="empty_examples">
+        <title>Other examples</title>
+        <programlisting role="example"><![CDATA[
+type(string([]))
+[type(int8([])) , type(int16([])) , type(int32([])) , type(int64([]))]
+[type(uint8([])), type(uint16([])), type(uint32([])), type(uint64([]))]
+[] * %F
+     ]]></programlisting>
+        <screen><![CDATA[
+--> type(string([]))
+ ans  =
+   1.
+
+--> [type(int8([])) , type(int16([])) , type(int32([])) , type(int64([]))]
+ ans  =
+   1.   1.   1.   1.
+
+--> [type(uint8([])), type(uint16([])), type(uint32([])), type(uint64([]))]
+ ans  =
+   1.   1.   1.   1.
+
+--> [] * %F
+ ans  =
+    []
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+A = [%s-1, %s^2]
+A + []
+A - []
+A * []
+     ]]></programlisting>
+        <screen><![CDATA[
+--> A = [%s-1, %s^2]
+ A  =
+           2
+  -1 +s   s
+
+--> A + []
+ ans  =
+    []
+
+--> A - []
+ ans  =
+    []
+
+--> A * []
+ ans  =
+    []
+]]></screen>
+        <para/>
         <programlisting role="example"><![CDATA[
-s=poly(0,'s');
-A = [s, s+1];
-A+[], A*[]
-A=rand(2,2);
-AA=A([],1), size(AA)
-svd([])
-w=ssrand(2,2,2);
-wr=[]*w;
-size(wr), w1=ss2tf(wr), size(w1)
- ]]></programlisting>
+string([]) == []
+["a" "bc"] + []
+[] + ["a" "bc"]
+     ]]></programlisting>
+        <screen><![CDATA[
+--> string([]) == []
+ ans  =
+  T
+
+--> ["a" "bc"] + []
+ ans  =
+    []
+
+--> [] + ["a" "bc"]
+ ans  =
+    []
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+A = rand(2,2);
+A([],:)
+     ]]></programlisting>
+        <screen><![CDATA[
+--> A = rand(2,2);
+--> A([],:)
+ ans  =
+    []
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+[det([]) rank([]) trace([]) norm([]) cond([]) rcond([])]
+     ]]></programlisting>
+        <screen><![CDATA[
+--> [det([]) rank([]) trace([]) norm([]) cond([]) rcond([])]
+ ans  =
+   1.   0.   0.   0.   0.   Inf
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+[sum([]) prod([]) mean([]) median([]) stdev([]) mad([])]
+     ]]></programlisting>
+        <screen><![CDATA[
+--> [sum([]) prod([]) mean([]) median([]) stdev([]) mad([])]
+ ans  =
+   0.   1.   Nan   Nan   Nan   Nan
+]]></screen>
     </refsection>
-    <refsection role="see also">
+    <refsection role="see also" id="empty_seealso">
         <title>See also</title>
         <simplelist type="inline">
             <member>
@@ -64,9 +552,15 @@ size(wr), w1=ss2tf(wr), size(w1)
             <member>
                 <link linkend="matrices">matrices</link>
             </member>
+            <member>
+                <link linkend="oldEmptyBehaviour">oldEmptyBehaviour</link>
+            </member>
+            <member>
+                <link linkend="insertion">insertion</link>
+            </member>
         </simplelist>
     </refsection>
-    <refsection>
+    <refsection id="empty_history">
         <title>History</title>
         <revhistory>
             <revision>
diff --git a/scilab/modules/elementary_functions/help/fr_FR/elementarymatrices/empty.xml b/scilab/modules/elementary_functions/help/fr_FR/elementarymatrices/empty.xml
deleted file mode 100644 (file)
index db82779..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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="fr" xml:id="empty">
-    <refnamediv>
-        <refname>empty ([])</refname>
-        <refpurpose>matrice vide  </refpurpose>
-    </refnamediv>
-    <refsection>
-        <title>Description</title>
-        <para>
-            <literal> [] </literal> désigne une matrice vide. Elle est définie de façon unique et possède
-            0 ligne et 0 colonne, soit <literal> size([]) = [0,0] </literal>.
-            Les convention suivantes sont adoptées :
-        </para>
-        <para>
-            <literal> [] * A = A * [] = [] </literal>
-        </para>
-        <para>
-            <literal> [] + A = A + [] = [] </literal>
-        </para>
-        <para>
-            <literal> [ [], A] = [A, []] = A </literal>
-        </para>
-        <para>
-            Les fonctions matricielles renvoient <literal>[]</literal> ou un message d'erreur
-            quand il n'y pas de réponse évidente. Les systèmes dynamiques linéaires
-            (listes de type <literal>syslin</literal>) peuvent avoir plusieurs lignes ou colonnes.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Exemples</title>
-        <programlisting role="example"><![CDATA[
-s=poly(0,'s');
-A = [s, s+1];
-A+[], A*[]
-A=rand(2,2);
-AA=A([],1), size(AA)
-svd([])
-w=ssrand(2,2,2);
-wr=[]*w;
-size(wr), w1=ss2tf(wr), size(w1)
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Voir aussi</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="null">null</link>
-            </member>
-            <member>
-                <link linkend="isempty">isempty</link>
-            </member>
-            <member>
-                <link linkend="emptystr">emptystr</link>
-            </member>
-            <member>
-                <link linkend="brackets">crochets []</link>
-            </member>
-            <member>
-                <link linkend="symbols">opérateurs</link>
-            </member>
-            <member>
-                <link linkend="matrices">matrices</link>
-            </member>
-        </simplelist>
-    </refsection>
-    <refsection>
-        <title>Historique</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0.0</revnumber>
-                <revremark>
-                    <itemizedlist>
-                      <listitem>
-                          <literal>A+[]</literal>, <literal>[]+A</literal> et <literal>A-[]</literal>
-                          produisent désormais <literal>[]</literal> au lieu de <literal>A</literal>.
-                          <literal>[]-A</literal> produit <literal>[]</literal> au lieu de
-                          <literal>-A</literal>.
-                      </listitem>
-                      <listitem>
-                         <literal> A>[] </literal>, <literal> A>=[] </literal>,
-                         <literal> A&lt;[] </literal>, <literal> A&lt;=[] </literal>,
-                         <literal> []>A </literal>, <literal> []>=A </literal>,
-                         <literal> []&lt;A </literal>, et <literal> []&lt;=A </literal> produisent
-                         désormais <literal> [] </literal> au lieu d'une erreur.
-                      </listitem>
-                    </itemizedlist>
-                </revremark>
-            </revision>
-        </revhistory>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/elementary_functions/help/ja_JP/elementarymatrices/empty.xml b/scilab/modules/elementary_functions/help/ja_JP/elementarymatrices/empty.xml
deleted file mode 100644 (file)
index 591c8ef..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<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="ja" xml:id="empty">
-    <refnamediv>
-        <refname>empty</refname>
-        <refpurpose>([]) 空行列</refpurpose>
-    </refnamediv>
-    <refsection>
-        <title>説明</title>
-        <para>
-            <literal> [] </literal> は空行列を定義します.
-            この行列は特殊な行列として定義され,
-            0行0列,すなわち<literal> size([]) =[0,0] </literal>となります.
-            以下の便利な表記が使用可能です:
-        </para>
-        <para>
-            <literal> [] * A = A * [] = [] </literal>
-        </para>
-        <para>
-            <literal> [] + A = A + [] = [] </literal>
-        </para>
-        <para>
-            <literal> [ [], A] = [A, []] = A </literal>
-        </para>
-        <para>
-            明示的な答えがない場合,行列関数は <literal>[]</literal> またはエラーメッセージを
-            返します. 空の線形システム
-            (<literal> syslin</literal> リスト) は複数の行または列を有する可能性があります.
-        </para>
-    </refsection>
-    <refsection>
-        <title>例s</title>
-        <programlisting role="example"><![CDATA[
-s=poly(0,'s'); A = [s, s+1];
-A+[], A*[]
-A=rand(2,2); AA=A([],1), size(AA)
-svd([])
-w=ssrand(2,2,2); wr=[]*w; size(wr), w1=ss2tf(wr), size(w1)
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>参照</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="null">null</link>
-            </member>
-            <member>
-                <link linkend="isempty">isempty</link>
-            </member>
-            <member>
-                <link linkend="emptystr">emptystr</link>
-            </member>
-            <member>
-                <link linkend="brackets">brackets</link>
-            </member>
-            <member>
-                <link linkend="symbols">operators</link>
-            </member>
-            <member>
-                <link linkend="matrices">matrices</link>
-            </member>
-        </simplelist>
-    </refsection>
-
-    <refsection>
-        <title>履歴</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0.0</revnumber>
-                <revremark>
-                    <itemizedlist>
-                      <listitem>
-                          <literal>A+[]</literal>, <literal>[]+A</literal> and <literal>A-[]</literal>
-                          now return <literal>[]</literal> instead of <literal>A</literal>.
-                          <literal>[]-A</literal> now returns <literal>[]</literal> instead of
-                          <literal>-A</literal>.
-                      </listitem>
-                      <listitem>
-                         <literal> A>[] </literal>, <literal> A>=[] </literal>,
-                         <literal> A&lt;[] </literal>, <literal> A&lt;=[] </literal>,
-                         <literal> []>A </literal>, <literal> []>=A </literal>,
-                         <literal> []&lt;A </literal>, and <literal> []&lt;=A </literal> now return
-                         <literal> [] </literal> instead of an error.
-                      </listitem>
-                    </itemizedlist>
-                </revremark>
-            </revision>
-        </revhistory>
-    </refsection>
-</refentry>
diff --git a/scilab/modules/elementary_functions/help/pt_BR/elementarymatrices/empty.xml b/scilab/modules/elementary_functions/help/pt_BR/elementarymatrices/empty.xml
deleted file mode 100644 (file)
index e62226f..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
-          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
-          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
-          xmlns:scilab="http://www.scilab.org" xml:id="empty" xml:lang="pt">
-    <refnamediv>
-        <refname>empty</refname>
-        <refpurpose>([]) matriz vazia</refpurpose>
-    </refnamediv>
-    <refsection>
-        <title>Descrição</title>
-        <para>
-            <literal> [] </literal> denota a matriz vazia. É definida de modo
-            único e possui 0 linha e 0 coluna, i.e. <literal> size([]) =[0,0]
-            </literal>
-            .As seguintes convenções convenientes foram feitas:
-        </para>
-        <para>
-            <literal> [] * A = A * [] = [] </literal>
-        </para>
-        <para>
-            <literal> [] + A = A + [] = [] </literal>
-        </para>
-        <para>
-            <literal> [ [], A] = [A, []] = A </literal>
-        </para>
-        <para>
-            Funções de matrizes retornam <literal>[]</literal> ou produzem uma
-            mensagem de erro quando não há resposta óbvia. Sistemas lineares vazios
-            (listas<literal> syslin</literal>) podem ter várias linhas ou
-            colunas.
-        </para>
-    </refsection>
-    <refsection>
-        <title>Exemplos</title>
-        <programlisting role="example"><![CDATA[
-s=poly(0,'s');
-A = [s, s+1];
-A+[], A*[]
-A=rand(2,2);
-AA=A([],1), size(AA)
-svd([])
-w=ssrand(2,2,2);
-wr=[]*w;
-size(wr), w1=ss2tf(wr), size(w1)
- ]]></programlisting>
-    </refsection>
-    <refsection role="see also">
-        <title>Ver Também</title>
-        <simplelist type="inline">
-            <member>
-                <link linkend="null">null</link>
-            </member>
-            <member>
-                <link linkend="isempty">isempty</link>
-            </member>
-            <member>
-                <link linkend="emptystr">emptystr</link>
-            </member>
-            <member>
-                <link linkend="brackets">brackets</link>
-            </member>
-            <member>
-                <link linkend="symbols">operators</link>
-            </member>
-            <member>
-                <link linkend="matrices">matrices</link>
-            </member>
-        </simplelist>
-    </refsection>
-    <refsection>
-        <title>Histórico</title>
-        <revhistory>
-            <revision>
-                <revnumber>6.0.0</revnumber>
-                <revremark>
-                    <itemizedlist>
-                      <listitem>
-                          <literal>A+[]</literal>, <literal>[]+A</literal> and <literal>A-[]</literal>
-                          now return <literal>[]</literal> instead of <literal>A</literal>.
-                          <literal>[]-A</literal> now returns <literal>[]</literal> instead of
-                          <literal>-A</literal>.
-                      </listitem>
-                      <listitem>
-                         <literal> A>[] </literal>, <literal> A>=[] </literal>,
-                         <literal> A&lt;[] </literal>, <literal> A&lt;=[] </literal>,
-                         <literal> []>A </literal>, <literal> []>=A </literal>,
-                         <literal> []&lt;A </literal>, and <literal> []&lt;=A </literal> now return
-                         <literal> [] </literal> instead of an error.
-                      </listitem>
-                    </itemizedlist>
-                </revremark>
-            </revision>
-        </revhistory>
-    </refsection>
-</refentry>
index 6a9bcc2..e3dc605 100644 (file)
 <?xml version="1.0" encoding="UTF-8"?>
-<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="ru" xml:id="empty">
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
+ *
+ * This file is hereby licensed under the terms of the GNU GPL v2.0,
+ * pursuant to article 5.3.4 of the CeCILL v.2.1.
+ * This file was originally licensed under the terms of the CeCILL v2.1,
+ * and continues to be available under such terms.
+ * For more information, see the COPYING file which you should have received
+ * along with this program.
+ *
+ -->
+<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="ru" xml:id="empty">
     <refnamediv>
-        <refname>empty</refname>
-        <refpurpose>([]) пустая матрица</refpurpose>
+        <refname>пустая матрица []</refname>
+        <refpurpose>пустая матрица. Деструктор диапазонов массива.</refpurpose>
     </refnamediv>
     <refsection>
+        <title>Содержание</title>
+        <simplelist type="inline">
+            <member>
+                <link linkend="empty_general_properties">Общие свойства [ ]</link>
+            </member>
+            <member>
+                <link linkend="empty_operand_or_argument">[ ] в качестве операнда или входного аргумента</link>
+            </member>
+            <member>
+                <link linkend="empty_assigned_as_destructor">[ ] в качестве деструктора диапазонов</link>
+            </member>
+            <member>
+                <link linkend="empty_examples">Примеры</link>
+            </member>
+            <member>
+                <link linkend="empty_seealso">Смотрите также</link>
+            </member>
+            <member>
+                <link linkend="empty_history">История</link>
+            </member>
+        </simplelist>
+    </refsection>
+    <refsection>
         <title>Описание</title>
+        <refsect3 id="empty_general_properties">
+            <title>Общие свойства [ ]</title>
+            <para>
+            Пустые квадратные скобки <literal>[]</literal> представляют пустую матрицу. Опишем её общие свойства.
+            </para>
+            <orderedlist>
+                <listitem>
+                    <para>
+                    Она имеет лишь две размерности. Любая размерность больше двух автоматически сокращается:
+                    <screen><![CDATA[
+--> e = ones(1,2,0,2); size(e)
+ ans  =
+   0.   0.
+--> e == []
+ ans  =
+  T
+]]></screen>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    Она всегда вещественного десятичного типа. Нет пустых матриц ни целочисленного типа
+                    (int8, uint8, int16, uint16, int32, uint32, int64, uint64), ни строкового типа, и т.д.:
+                    <screen><![CDATA[
+--> type(uint8([]))  // не типа 8 (кодированные целые числа)
+ ans  =
+   1.
+--> a = [1 2 ; 3 4] + %i;
+--> a(1,:) = []
+ a  =
+   3. + i     4. + i
+--> a(1,:) = [], isreal(a)
+ a  =
+    []
+ ans  =
+  T
+--> t = "abcd efg", type(t)
+ t  =
+ abcd efg
+ ans  =
+   10.
+--> t(1) = [], type(t)
+ t  =
+    []
+ ans  =
+   1.
+]]></screen>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    Однако она всегда отличается от разрежённой пустой матрицы:
+                    <screen><![CDATA[
+--> se = sparse([])
+ se  =
+(  0,  0) zero sparse matrix
+--> size(se)
+ ans  =
+   0.   0.
+--> se == []
+ ans  =
+  F
+]]></screen>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    Она также отличается от всех пустых разнотипных контейнеров
+                    <literal>list()</literal>, <literal>struct()</literal> или
+                    <literal>cell()</literal> :
+                    <screen><![CDATA[
+--> L = list()
+ L  =
+     ()
+--> L == []
+ ans  =
+  F
+--> s = struct()
+ s  =
+0x0 struct array with no fields.
+--> s == []
+ ans  =
+  F
+--> c = cell()
+ c  =
+   {}
+--> c == []
+ ans  =
+  F
+]]></screen>
+                    </para>
+                </listitem>
+            </orderedlist>
+        </refsect3>
+        <refsect3 id="empty_operand_or_argument">
+            <title>[ ] в качестве операнда или входного аргумента</title>
+            <orderedlist>
+                <listitem>
+                    <para>
+                    В качестве операнда обычных предопределённых небулевых операторов [] устанавливает результат равным [].
+                    <emphasis>Все следующие операции дают</emphasis> []:
+                    <table>
+                        <tr><td colspan="2"><emphasis role="bold">Унарные операторы</emphasis></td></tr>
+                        <tr><td colspan="2">[]', [].', -[],  ~[]</td></tr>
+                        <tr><td></td><td></td></tr>
+                        <tr><td colspan="2"><emphasis role="bold">Binary numerical operators</emphasis></td></tr>
+                        <tr><td>суммирование:</td>      <td> [] + [1 2], [1 2] + []</td></tr>
+                        <tr><td>вычитание:</td>   <td> [] - [1 2], [1 2] - []</td></tr>
+                        <tr><td>деление:</td>      <td> []/[1 2], []./[1 2], [1 2]/[], [1 2]./[]</td></tr>
+                        <tr><td>левое деление:</td> <td> []\[1 2], [].\[1 2], [1 2]\[], [1 2].\[]</td></tr>
+                        <tr><td>умножение:</td><td> []*[1 2], [].*[1 2], [1 2]*[], [1 2].*[]</td></tr>
+                        <tr><td>кронекер:</td>     <td> [].*.[1 2], [1 2].*.[]</td></tr>
+                        <tr><td>степень:</td>         <td> []^[1 2], [].^[1 2], [1 2]^[], [1 2].^[]</td></tr>
+                        <tr><td></td><td></td></tr>
+                        <tr><td colspan="2"><emphasis role="bold">Сравнение на неравенство</emphasis></td></tr>
+                        <tr><td>больше:</td><td> []>[1 2], []>=[1 2], [1 2]>[], [1 2]>=[]</td></tr>
+                        <tr><td>меньше:</td><td> []&lt;[1 2], []&lt;=[1 2], [1 2]&lt;[], [1 2]&lt;=[]</td></tr>
+                    </table>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    В качестве операнда булевых бинарных операторов [] <emphasis>эквивалентна %T</emphasis>:
+                    <table>
+                        <tr><td colspan="4"><emphasis role="bold">Двоичные числовые операторы</emphasis></td></tr>
+                        <tr><td>или:</td> <td> [] | [%T %F], [%T %F] | []        </td><td>→</td><td>[%T %T]</td></tr>
+                        <tr><td>и:</td><td> [] &amp; [%T %F], [%T %F] &amp; []</td><td>→</td><td>[%T %F]</td></tr>
+                    </table>
+                    </para>
+                    Но обратите внимание:
+                    <itemizedlist>
+                        <listitem>
+                            <para>
+                                <literal>or([])</literal> равно %F.
+                            </para>
+                        </listitem>
+                        <listitem>
+                            <para>
+                                В качестве условия любого <literal>if</literal> или <literal>while</literal>,
+                                [] равна %F:
+                                <screen><![CDATA[
+--> if []
+-->     r = "[] равно %T в любом условии if";
+--> else
+-->     r = "[] равно %F в любом условии if";
+--> end
+--> r
+ r  =
+ [] равно %F в любом условии if
+]]></screen>
+                            </para>
+                        </listitem>
+                    </itemizedlist>
+                </listitem>
+                <listitem>
+                    <para>
+                    При конкатенации [] просто игнорируется:
+                    <literal>[A,[]] == [[],A] == [A ; []] == [[] ; A] == A</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                    При конкатенации текста <literal>+[]</literal> даёт []:
+                    <literal>[]+["a" "bc"] == ["a" "bc"]+[] == []</literal>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                        В качестве специальной входной матрицы функций линейной алгебры или общих функций
+                        ответ зависит от конкретной функции. Он документируется на странице справки для
+                        каждой функции. Например:
+                    </para>
+                    <para>
+                    <table>
+                    <tr>
+                    <td>
+                    <table>
+                        <tr><td><literal>det([])</literal></td>     <td><literal>1</literal></td></tr>
+                        <tr><td><literal>rank([])</literal></td>    <td><literal>0</literal></td></tr>
+                        <tr><td><literal>trace([])</literal></td>   <td><literal>0</literal></td></tr>
+                        <tr><td><literal>norm([])</literal></td>    <td><literal>0</literal></td></tr>
+                        <tr><td><literal>cond([])</literal></td>    <td><literal>0</literal></td></tr>
+                        <tr><td><literal>rcond([])</literal></td>   <td><literal>Inf</literal></td></tr>
+                    </table>
+                    </td>
+                    <td></td>
+                    <td>
+                    <table>
+                        <tr><td><literal>diag([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>tril([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>triu([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>min([])</literal></td>     <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>max([])</literal></td>     <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>sign([])</literal></td>    <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>clean([])</literal></td>   <td><literal>[]</literal></td></tr>
+                        <tr><td><literal>svd([])</literal></td>     <td><literal>[]</literal></td></tr>
+                    </table>
+                    </td>
+                    <td></td>
+                    <td>
+                    <table>
+                        <tr><td><literal>sum([])</literal></td>     <td><literal>0</literal></td></tr>
+                        <tr><td><literal>prod([])</literal></td>    <td><literal>1</literal></td></tr>
+                        <tr><td><literal>mean([])</literal></td>    <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>median([])</literal></td>  <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>stdev([])</literal></td>   <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>mad([])</literal></td>     <td><literal>Nan</literal></td></tr>
+                        <tr><td><literal>variance([])</literal></td><td><literal>Nan</literal></td></tr>
+                    </table>
+                    </td>
+                    </tr>
+                    </table>
+                    </para>
+                </listitem>
+                <listitem>
+                    <para>
+                        В качестве входного аргумента функций [] часто используется для выбора значения
+                        по умолчанию входного аргумента (чтобы как-то пропусть его, избежать указания 
+                        фактического конкретного значения). Однако это не жёсткое правило.
+                    </para>
+                </listitem>
+                <!--
+                <listitem>
+                    <para>
+                        Пустая линейная система (списки <literal> syslin</literal>) может иметь несколько
+                        строк или столбцов.
+                        w=ssrand(2,2,2);
+                        wr=[]*w;
+                        size(wr), w1=ss2tf(wr), size(w1)
+                    </para>
+                </listitem>
+                -->
+            </orderedlist>
+        </refsect3>
+        <refsect3 id="empty_assigned_as_destructor">
+            <title>Использование [ ] для удаления диапазонов в массивах</title>
+        </refsect3>
         <para>
-            <literal> [] </literal> означает пустую матрицу. Она определяется уникально
-            и имеет 0 строк и 0 столбцов, т.е. <literal> size([]) =[0,0] </literal>.
-            Сделаны следующие удобные соглашения:
-        </para>
-        <para>
-            <literal> [] * A = A * [] = [] </literal>
+            Что касается массива любого количества размерностей и любого размера, который может быть
+            матрицей или гиперматрицей любого типа данных, массивом структура или cell-массивом, то
+            [] может использоваться для удаления указанного диапазона (строк, столбцов и т.д.). Это
+            указание должно перекрывать полный размер массива по крайней мере вдоль одной из его
+            размерностей.
         </para>
+        <para>Примеры:</para>
+        <para>С матрицей десятичных чисел:</para>
+        <programlisting role="example"><![CDATA[
+a = grand(3,5,"uin",0,9)
+     ]]></programlisting>
+        <screen><![CDATA[
+--> a = grand(3,5,"uin",0,9)
+ a  =
+   2.   4.   8.   0.   9.
+   2.   1.   3.   6.   4.
+   4.   9.   5.   9.   7.
+--> a(:,[3 5]) = []
+ a  =
+   2.   4.   0.
+   2.   1.   6.
+   4.   9.   9.
+--> a(2,:) = []
+ a  =
+   2.   4.   0.
+   4.   9.   9.
+]]></screen>
         <para>
-            <literal> [] + A = A + [] = [] </literal>
+            С гиперматрицей текстовых значений:
         </para>
+        <programlisting role="example"><![CDATA[
+cs = cumsum(grand(2,4,3,"uin",1,3));
+t = matrix(strsplit(ascii(grand(1,cs($),"uin",ascii("a"),ascii("c"))),cs(1:$-1)),2,4,3)
+     ]]></programlisting>
+        <screen><![CDATA[
+--> cs = cumsum(grand(2,4,3,"uin",1,3));
+--> t = matrix(strsplit(ascii(grand(1,cs($),"uin",ascii("a"),ascii("c"))),cs(1:$-1)),2,4,3)
+ t  =
+(:,:,1)
+!ccc  b    b   b  !
+!bbb  bcc  bc  c  !
+(:,:,2)
+!aa  aab  bc  a   !
+!ab  a    cc  ba  !
+(:,:,3)
+!c   aba  c    abb  !
+!bc  cc   acb  c    !
+--> t(:,3,:) = []  // Удаление всех третьих столбцов
+ t  =
+(:,:,1)
+!ccc  b    b  !
+!bbb  bcc  c  !
+(:,:,2)
+!aa  aab  a   !
+!ab  a    ba  !
+(:,:,3)
+!c   aba  abb  !
+!bc  cc   c    !
+--> t(:,:,2) = []   // Удаление второй страницы
+ t  =
+(:,:,1)
+!ccc  b    b  !
+!bbb  bcc  c  !
+(:,:,2)
+!c   aba  abb  !
+!bc  cc   c    !
+]]></screen>
         <para>
-            <literal> [ [], A] = [A, []] = A </literal>
+            С cell-массивами:
         </para>
+        <programlisting role="example"><![CDATA[
+c = cat(3, {"start", -1.23, %f  ; (1-%s)^2, gda(), list(2,,%z)}, ..
+           {%t     , "abc", 5.2 ; int8(21), []   , %z})
+     ]]></programlisting>
+        <screen><![CDATA[
+--> c = cat(3, {"start", -1.23, %f  ; (1-%s)^2, gda(), list(2,,%z)}, ..
+               {%t     , "abc", 5.2 ; int8(21), []   , %z})
+ c  =
+(:,:,1)
+  [1x1 string    ]  [1x1 constant]  [1x1 boolean]
+  [1x1 polynomial]  [1x1 handle  ]  [    list   ]
+(:,:,2)
+  [1x1 boolean]  [1x1 string  ]  [1x1 constant  ]
+  [1x1 int8   ]  [0x0 constant]  [1x1 polynomial]
+--> c(:,2,:) = []                   // Удаление всех вторых столбцов
+ c  =
+(:,:,1)
+  [1x1 string    ]  [1x1 boolean]
+  [1x1 polynomial]  [    list   ]
+(:,:,2)
+  [1x1 boolean]  [1x1 constant  ]
+  [1x1 int8   ]  [1x1 polynomial]
+--> c(1,:,:) = []                   // Удаление всех первых строк
+ c  =
+(:,:,1)
+  [1x1 polynomial]  [ list]
+(:,:,2)
+  [1x1 int8]  [1x1 polynomial]
+]]></screen>
         <para>
-            Матричные функции возвращают <literal>[]</literal> или сообщение об
-            ошибке, если нет однозначного ответа. Пустые линейные системы (списки
-            <literal>syslin</literal>) могут иметь несколько строк или столбцов.
+            С массивом структур:
         </para>
+        <screen><![CDATA[
+--> s(4,5).r = %pi;
+--> s.b = %t
+ s  =
+4x5 struct array with fields:
+   r
+   b
+--> s([1 3],:) = []
+ s  =
+2x5 struct array with fields:
+   r
+   b
+--> s(:,2) = []
+ s  =
+2x4 struct array with fields:
+   r
+   b
+]]></screen>
     </refsection>
-    <refsection>
-        <title>Примеры</title>
+    <refsection id="empty_examples">
+        <title>Другие примеры</title>
+        <programlisting role="example"><![CDATA[
+type(string([]))
+[type(int8([])) , type(int16([])) , type(int32([])) , type(int64([]))]
+[type(uint8([])), type(uint16([])), type(uint32([])), type(uint64([]))]
+[] * %F
+     ]]></programlisting>
+        <screen><![CDATA[
+--> type(string([]))
+ ans  =
+   1.
+--> [type(int8([])) , type(int16([])) , type(int32([])) , type(int64([]))]
+ ans  =
+   1.   1.   1.   1.
+--> [type(uint8([])), type(uint16([])), type(uint32([])), type(uint64([]))]
+ ans  =
+   1.   1.   1.   1.
+--> [] * %F
+ ans  =
+    []
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+A = [%s-1, %s^2]
+A + []
+A - []
+A * []
+     ]]></programlisting>
+        <screen><![CDATA[
+--> A = [%s-1, %s^2]
+ A  =
+           2
+  -1 +s   s
+--> A + []
+ ans  =
+    []
+--> A - []
+ ans  =
+    []
+--> A * []
+ ans  =
+    []
+]]></screen>
+        <para/>
         <programlisting role="example"><![CDATA[
-s=poly(0,'s');
-A = [s, s+1];
-A+[], A*[]
-A=rand(2,2);
-AA=A([],1), size(AA)
-svd([])
-w=ssrand(2,2,2);
-wr=[]*w;
-size(wr), w1=ss2tf(wr), size(w1)
- ]]></programlisting>
+string([]) == []
+["a" "bc"] + []
+[] + ["a" "bc"]
+     ]]></programlisting>
+        <screen><![CDATA[
+--> string([]) == []
+ ans  =
+  T
+--> ["a" "bc"] + []
+ ans  =
+    []
+--> [] + ["a" "bc"]
+ ans  =
+    []
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+A = rand(2,2);
+A([],:)
+     ]]></programlisting>
+        <screen><![CDATA[
+--> A = rand(2,2);
+--> A([],:)
+ ans  =
+    []
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+[det([]) rank([]) trace([]) norm([]) cond([]) rcond([])]
+     ]]></programlisting>
+        <screen><![CDATA[
+--> [det([]) rank([]) trace([]) norm([]) cond([]) rcond([])]
+ ans  =
+   1.   0.   0.   0.   0.   Inf
+]]></screen>
+        <para/>
+        <programlisting role="example"><![CDATA[
+[sum([]) prod([]) mean([]) median([]) stdev([]) mad([])]
+     ]]></programlisting>
+        <screen><![CDATA[
+--> [sum([]) prod([]) mean([]) median([]) stdev([]) mad([])]
+ ans  =
+   0.   1.   Nan   Nan   Nan   Nan
+]]></screen>
     </refsection>
-    <refsection role="see also">
+    <refsection role="see also" id="empty_seealso">
         <title>Смотрите также</title>
         <simplelist type="inline">
             <member>
@@ -61,9 +516,15 @@ size(wr), w1=ss2tf(wr), size(w1)
             <member>
                 <link linkend="matrices">matrices</link>
             </member>
+            <member>
+                <link linkend="oldEmptyBehaviour">oldEmptyBehaviour</link>
+            </member>
+            <member>
+                <link linkend="insertion">insertion</link>
+            </member>
         </simplelist>
     </refsection>
-    <refsection>
+    <refsection id="empty_history">
         <title>История</title>
         <revhistory>
             <revision>
@@ -71,17 +532,17 @@ size(wr), w1=ss2tf(wr), size(w1)
                 <revremark>
                     <itemizedlist>
                       <listitem>
-                          <literal>A+[]</literal>, <literal>[]+A</literal> and <literal>A-[]</literal>
-                          now return <literal>[]</literal> instead of <literal>A</literal>.
-                          <literal>[]-A</literal> now returns <literal>[]</literal> instead of
+                          <literal>A+[]</literal>, <literal>[]+A</literal> и <literal>A-[]</literal>
+                          теперь возвращают <literal>[]</literal> вместо <literal>A</literal>.
+                          <literal>[]-A</literal> теперь возвращают <literal>[]</literal> вместо
                           <literal>-A</literal>.
                       </listitem>
                       <listitem>
                          <literal> A>[] </literal>, <literal> A>=[] </literal>,
                          <literal> A&lt;[] </literal>, <literal> A&lt;=[] </literal>,
                          <literal> []>A </literal>, <literal> []>=A </literal>,
-                         <literal> []&lt;A </literal>, and <literal> []&lt;=A </literal> now return
-                         <literal> [] </literal> instead of an error.
+                         <literal> []&lt;A </literal> и <literal> []&lt;=A </literal> теперь возвращают
+                         <literal> [] </literal> вместо ошибки.
                       </listitem>
                     </itemizedlist>
                 </revremark>
@@ -89,3 +550,4 @@ size(wr), w1=ss2tf(wr), size(w1)
         </revhistory>
     </refsection>
 </refentry>
+
index 431962f..fddaedd 100644 (file)
                 <tr><th>18</th> <td>uint64</td> <td>[0, 18446744073709551615]</td></tr>
             </table>
         </para>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 == inttype 0
+           (decimal type).
+        </warning>
     </refsection>
     <refsection>
         <title>Examples</title>
index 8f87a75..c018ea8 100644 (file)
             For more details, please refer to the <link linkend="double">double()</link> page.
             </para>
         </warning>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 (decimal type).
+        </warning>
         <para>
             <table>
                 <tr><th>Function</th><th>y in</th><th align="left">=</th></tr>
@@ -259,6 +262,41 @@ uint8(-10.2 + 3.4*%i)
  ans  =
   246
 ]]></screen>
+    <para>
+        [] is not convertible:
+    </para>
+    <programlisting role="example"><![CDATA[
+i = uint16(3);
+i(1,2) = 5.6
+typeof(i)
+
+i = uint16([])
+i(1,2) = 2.3
+typeof(i)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> i = uint16(3);
+--> i(1,2) = 5.6
+ i  =
+  3  5
+
+--> typeof(i)
+ ans  =
+ uint16
+
+
+--> i = uint16([])
+ i  =
+    []
+
+--> i(1,2) = 2.3
+ i  =
+   0.   2.3
+
+--> typeof(i)
+ ans  =
+ constant
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>See also</title>
index cf59bb4..8c97d7f 100644 (file)
                 <tr><th>18</th> <td>uint64</td> <td>[0, 18446744073709551615]</td></tr>
             </table>
         </para>
+        <warning>
+            La conversion de <literal>[]</literal> ne change rien : son type 1 == inttype 0
+            est toujours conservé (type numérique décimal).
+        </warning>
     </refsection>
     <refsection>
         <title>Exemples</title>
index 69d19e0..0a76530 100644 (file)
             de la fonction <link linkend="double">double()</link> et un exemple ci-dessous.
             </para>
         </warning>
+        <warning>
+            La conversion de <literal>[]</literal> ne change rien : son type 1 est toujours
+            conservé (type numérique décimal).
+        </warning>
         <para>
             <table>
                 <tr><th>Fonction</th><th>y dans</th><th align="left">=</th></tr>
@@ -267,6 +271,41 @@ uint8(-10.2 + 3.4*%i)
  ans  =
   246
 ]]></screen>
+    <para>
+        [] n'est pas convertible:
+    </para>
+    <programlisting role="example"><![CDATA[
+i = uint16(3);
+i(1,2) = 5.6
+typeof(i)
+
+i = uint16([])
+i(1,2) = 2.3
+typeof(i)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> i = uint16(3);
+--> i(1,2) = 5.6
+ i  =
+  3  5
+
+--> typeof(i)
+ ans  =
+ uint16
+
+
+--> i = uint16([])
+ i  =
+    []
+
+--> i(1,2) = 2.3
+ i  =
+   0.   2.3
+
+--> typeof(i)
+ ans  =
+ constant
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>Voir aussi</title>
index 7a5455d..42d66f2 100644 (file)
                 <tr><th>18</th> <td>uint64</td> <td>[0, 18446744073709551615]</td></tr>
             </table>
         </para>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 == inttype 0
+           (decimal type).
+        </warning>
     </refsection>
     <refsection>
         <title>例</title>
index bdff6bf..a4175ef 100644 (file)
             For more details, please refer to the <link linkend="double">double()</link> page.
             </para>
         </warning>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 (decimal type).
+        </warning>
         <para>
             <table>
                 <tr><th>Function</th><th>y in</th><th align="left">=</th></tr>
@@ -259,6 +262,41 @@ uint8(-10.2 + 3.4*%i)
  ans  =
   246
 ]]></screen>
+    <para>
+        [] is not convertible:
+    </para>
+    <programlisting role="example"><![CDATA[
+i = uint16(3);
+i(1,2) = 5.6
+typeof(i)
+
+i = uint16([])
+i(1,2) = 2.3
+typeof(i)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> i = uint16(3);
+--> i(1,2) = 5.6
+ i  =
+  3  5
+
+--> typeof(i)
+ ans  =
+ uint16
+
+
+--> i = uint16([])
+ i  =
+    []
+
+--> i(1,2) = 2.3
+ i  =
+   0.   2.3
+
+--> typeof(i)
+ ans  =
+ constant
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>参照</title>
index a4c3d5a..7025463 100644 (file)
                 <tr><th>18</th> <td>uint64</td> <td>[0, 18446744073709551615]</td></tr>
             </table>
         </para>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 == inttype 0
+           (decimal type).
+        </warning>
     </refsection>
     <refsection>
         <title>Exemplos</title>
index b7d22fa..3b4a708 100644 (file)
             For more details, please refer to the <link linkend="double">double()</link> page.
             </para>
         </warning>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 (decimal type).
+        </warning>
         <para>
             <table>
                 <tr><th>Function</th><th>y in</th><th align="left">=</th></tr>
@@ -266,6 +269,41 @@ uint8(-10.2 + 3.4*%i)
  ans  =
   246
 ]]></screen>
+    <para>
+        [] is not convertible:
+    </para>
+    <programlisting role="example"><![CDATA[
+i = uint16(3);
+i(1,2) = 5.6
+typeof(i)
+
+i = uint16([])
+i(1,2) = 2.3
+typeof(i)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> i = uint16(3);
+--> i(1,2) = 5.6
+ i  =
+  3  5
+
+--> typeof(i)
+ ans  =
+ uint16
+
+
+--> i = uint16([])
+ i  =
+    []
+
+--> i(1,2) = 2.3
+ i  =
+   0.   2.3
+
+--> typeof(i)
+ ans  =
+ constant
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>Ver Também</title>
index 67f9d9f..5cb53ff 100644 (file)
                 <tr><th>18</th> <td>uint64</td> <td>[0, 18446744073709551615]</td></tr>
             </table>
         </para>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 == inttype 0
+           (decimal type).
+        </warning>
     </refsection>
     <refsection>
         <title>Примеры</title>
index e5fd52f..b0f6f13 100644 (file)
             For more details, please refer to the <link linkend="double">double()</link> page.
             </para>
         </warning>
+        <warning>
+            Converting <literal>[]</literal> always keeps it as is, of type 1 (decimal type).
+        </warning>
         <para>
             <table>
                 <tr><th>Function</th><th>y in</th><th align="left">=</th></tr>
@@ -260,6 +263,41 @@ uint8(-10.2 + 3.4*%i)
  ans  =
   246
 ]]></screen>
+    <para>
+        [] is not convertible:
+    </para>
+    <programlisting role="example"><![CDATA[
+i = uint16(3);
+i(1,2) = 5.6
+typeof(i)
+
+i = uint16([])
+i(1,2) = 2.3
+typeof(i)
+ ]]></programlisting>
+    <screen><![CDATA[
+--> i = uint16(3);
+--> i(1,2) = 5.6
+ i  =
+  3  5
+
+--> typeof(i)
+ ans  =
+ uint16
+
+
+--> i = uint16([])
+ i  =
+    []
+
+--> i(1,2) = 2.3
+ i  =
+   0.   2.3
+
+--> typeof(i)
+ ans  =
+ constant
+]]></screen>
     </refsection>
     <refsection role="see also">
         <title>Смотрите также</title>
index 25077b6..f675cf2 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA -
  * Copyright (C) DIGITEO - 2012 - Allan CORNET
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="en">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="en">
     <refnamediv>
         <refname>string</refname>
         <refpurpose>conversion to string</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Syntax</title>
-        <synopsis>string(x)
-            [out, in, text] = string(x)
+        <synopsis>
+            text = string(x)
+            [out, in, text] = string(SciFun)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
                 <listitem>
                     <para>
                         a boolean, complex, real, integer, polynomial matrix,
-                        an implicit size, a library or a function.
+                        an implicitlist (like 1:$), a library of functions in Scilab language.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>SciFun</term>
+                <listitem>
+                    <para>
+                        a function in Scilab language (type 13, not its name as a string).
                     </para>
                 </listitem>
             </varlistentry>
             The <function>string</function> function converts a matrix <varname>x</varname> into a matrix of strings.
         </para>
         <para>
-            If <varname>x</varname> is a function <code>[out, in, text] = string(x)</code>
-            returns three vectors of strings: <varname>out</varname>
-            is the vector of output variables, <varname>in</varname> is the vector of
-            input variables, and <varname>text</varname> is the (column) vector of the
-            source code of the function.
+            If <varname>SciFun</varname> is a function, <literal>[out,in,text] = string(SciFun)</literal>
+            returns three vectors of strings:
+            <itemizedlist>
+                <listitem>
+                    <varname>out</varname> is the row vector of names of its output variables,
+                </listitem>
+                <listitem>
+                    <varname>in</varname> is the row vector of names of its input variables, and
+                </listitem>
+                <listitem>
+                    <varname>text</varname> is the column vector of the source code of the function.
+                </listitem>
+            </itemizedlist>
         </para>
         <para>
             If <varname>x</varname> is a <literal>lib</literal> variable
             (library), <varname>text</varname> is a character string column vector. The first element
-            contains the path of library file and the other the name of functions it
-            defines.
-        </para>
-        <para>
-            Character strings are defined as <literal>'string'</literal>
-            (between quotes) or <literal>"string"</literal> (between doublequotes);
-            matrices of strings are defined as usual constant matrices.
+            contains the path of library file and the other the name of functions it defines.
         </para>
+        <warning>
+            For any complex, real, integer, polynomial or rational input, the format of literal
+            numbers output from <function>string(..)</function> is managed by the
+            <link linkend="format">format</link> function (see examples).
+        </warning>
         <para>
-            Concatenation of strings is made by the <literal>+</literal>
-            operation.
-        </para>
-        <para>
-            For complex, real, integer, polynomial matrix
-            <function>string</function> output is managed by <link linkend="format">format</link> function (see examples).
-        </para>
-        <para>
-            Note that string([]) returns [].
+            Note that string([]) returns [] (unchanged).
         </para>
     </refsection>
     <refsection>
         <title>See also</title>
         <simplelist type="inline">
             <member>
-                <link linkend="part">part</link>
-            </member>
-            <member>
-                <link linkend="length">length</link>
+                <link linkend="format">format</link>
             </member>
             <member>
-                <link linkend="quote">quote</link>
+                <link linkend="sci2exp">sci2exp</link>
             </member>
             <member>
-                <link linkend="evstr">evstr</link>
+                <link linkend="msprintf">msprintf</link>
             </member>
             <member>
-                <link linkend="execstr">execstr</link>
+                <link linkend="tree2code">tree2code</link>
             </member>
             <member>
-                <link linkend="strsubst">strsubst</link>
+                <link linkend="pol2str">pol2str</link>
             </member>
             <member>
-                <link linkend="strcat">strcat</link>
+                <link linkend="execstr">execstr</link>
             </member>
             <member>
-                <link linkend="strindex">strindex</link>
+                <link linkend="evstr">evstr</link>
             </member>
             <member>
-                <link linkend="sci2exp">sci2exp</link>
+                <link linkend="strtod">strtod</link>
             </member>
             <member>
-                <link linkend="format">format</link>
+                <link linkend="csvTextScan">csvTextScan</link>
             </member>
         </simplelist>
     </refsection>
             <revision>
                 <revnumber>5.4.0</revnumber>
                 <revremark>
-                    implicit size type managed as input argument.
+                    Input of implicitlist typeof accepted.
                 </revremark>
             </revision>
         </revhistory>
index 09b6f40..b7c0a5d 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA -
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="fr">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="fr">
     <refnamediv>
         <refname>string</refname>
         <refpurpose>conversion en chaîne de caractères</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Séquence d'appel</title>
-        <synopsis>string(x)
-            [out, in, text] = string(x)
+        <synopsis>
+            text = string(x)
+            [out, in, text] = string(SciFun)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
                     </para>
                 </listitem>
             </varlistentry>
+            <varlistentry>
+                <term>SciFun</term>
+                <listitem>
+                    <para>
+                        function en langage Scilab (identifiant de type 13, non son nom comme texte).
+                    </para>
+                </listitem>
+            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
         <title>Description</title>
         <para>Convertit une matrice en matrice de chaînes de caractères.</para>
         <para>
-            Si <literal>x</literal> est une fonction <literal>[out, in, text] =
-                string(x)
-            </literal>
+            Si <varname>SciFun</varname> est une fonction,
+            <literal>[out, in, text] = string(SciFun)</literal>
             retourne 3 vecteurs de chaînes de caractères :
-            <literal>out</literal> est le vecteur des variables de sortie,
-            <literal>in</literal> est le vecteur des variables d'entrée, et
-            <literal>text</literal> est le vecteur colonne du code source de la
-            fonction.
+            <itemizedlist>
+                <listitem>
+                    <varname>out</varname> est le vecteur des noms de ses variables de sortie,
+                </listitem>
+                <listitem>
+                    <varname>in</varname> est le vecteur des noms de ses variables d'entrée, et
+                </listitem>
+                <listitem>
+                    <varname>text</varname> est le vecteur colonne des lignes de code source de la fonction.
+                </listitem>
+            </itemizedlist>
         </para>
         <para>
-            Si <literal>x</literal> est une variable bibliotheque
+            Si <varname>x</varname> est une variable bibliotheque
             <literal>lib</literal>, text est un vecteur colonne de chaînes de
             caractères. Le premier élément contient le chemin de la bibliothèque et
             l'autre élément le nom des fonctions qui sont définies dans cette
             bibliothèque.
         </para>
-        <para>Les chaînes de caractères sont définies de la façon suivant,
-            <literal>'string'</literal> (entre quotes) ou <literal>"string"</literal>
-            (entre double quotes); les matrices de chaînes de caractères sont définies
-            comme des matrices constantes normales.
-        </para>
-        <para>La concaténation des chaînes de caractères est effectuée par
-            l'opérateur <literal>+</literal>.
-        </para>
-        <para>
-            pour les types Booléen, complexe, réel, entier, polynôme matrice le texte issu de <literal>string</literal> est dependant de la fonction <link linkend="format">format</link> (voir exemples).
-        </para>
+        <warning>
+            pour les types Booléen, complexe, réel, entier, polynôme, fraction rationnelle, le
+            format texte des nombres et coefficients produits par <literal>string</literal>
+            est déterminé par la fonction <link linkend="format">format</link> (voir exemples).
+        </warning>
         <para>
-            Notez que string([]) renvoie [].
+            Notez que string([]) renvoie [] (inchangée).
         </para>
     </refsection>
     <refsection>
@@ -94,38 +106,51 @@ disp(string(%pi))
 format(24);
 disp(string(%pi))
 format(v(2))
+
+string(1:4:$)
  ]]></programlisting>
     </refsection>
     <refsection role="see also">
         <title>Voir aussi</title>
         <simplelist type="inline">
             <member>
-                <link linkend="part">part</link>
+                <link linkend="format">format</link>
             </member>
             <member>
-                <link linkend="length">length</link>
+                <link linkend="sci2exp">sci2exp</link>
             </member>
             <member>
-                <link linkend="quote">quote</link>
+                <link linkend="msprintf">msprintf</link>
             </member>
             <member>
-                <link linkend="evstr">evstr</link>
+                <link linkend="tree2code">tree2code</link>
             </member>
             <member>
-                <link linkend="execstr">execstr</link>
+                <link linkend="pol2str">pol2str</link>
             </member>
             <member>
-                <link linkend="strsubst">strsubst</link>
+                <link linkend="execstr">execstr</link>
             </member>
             <member>
-                <link linkend="strcat">strcat</link>
+                <link linkend="evstr">evstr</link>
             </member>
             <member>
-                <link linkend="strindex">strindex</link>
+                <link linkend="strtod">strtod</link>
             </member>
             <member>
-                <link linkend="sci2exp">sci2exp</link>
+                <link linkend="csvTextScan">csvTextScan</link>
             </member>
         </simplelist>
     </refsection>
+    <refsection>
+        <title>Historique</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.4.0</revnumber>
+                <revremark>
+                    implicitlist typeof input accepted.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index fbb059f..3d48c93 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA -
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<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="ja" xml:id="string">
+<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="ja" xml:id="string">
     <refnamediv>
         <refname>string</refname>
         <refpurpose>文字列に変換</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>呼び出し手順</title>
-        <synopsis>string(x)
-            [out, in, text] = string(x)
+        <synopsis>
+            text = string(x)
+            [out, in, text] = string(SciFun)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
                 <term>x</term>
                 <listitem>
                     <para>
-                        論理値, 複素数, 実数, 整数, 多項式行列,
-                        暗黙の大きさ, ライブラリまたは関数.
+                        論理値, 複素数, 実数, 整数, 多項式行列, 暗黙の大きさ, またはライブラリ.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>SciFun</term>
+                <listitem>
+                    <para>
+                        a function in Scilab language (handle of type 13, not its name as a string).
                     </para>
                 </listitem>
             </varlistentry>
             行列<varname>x</varname> を文字列の行列に変換します.
         </para>
         <para>
-            <literal>x</literal>が関数の場合,
-            <code>[out, in, text] = string(x)</code> は
+            <literal>SciFun</literal>が関数の場合,
+            <code>[out, in, text] = string(SciFun)</code> は
             3つの文字列ベクトルを返します:
-            <literal>out</literal> は出力変数のベクトル,
-            <literal>in</literal> は入力変数のベクトル, そして <literal>text</literal> は
-            関数のソースコードの(列)ベクトルです.
+            <itemizedlist>
+                <listitem>
+                    <varname>out</varname> は出力変数のベクトル,
+                </listitem>
+                <listitem>
+                    <varname>in</varname> は入力変数のベクトル, そして
+                </listitem>
+                <listitem>
+                    <varname>text</varname> は関数のソースコードの(列)ベクトルです.
+                </listitem>
+            </itemizedlist>
         </para>
         <para>
             <literal>x</literal>が <literal>lib</literal>変数の場合,
             最初の要素は,ライブラリファイルのパス,
             その他の要素は定義する関数の名前を有します.
         </para>
-        <para>
-            文字列は<literal>'string'</literal> (引用符で括る)または
-            <literal>"string"</literal> (二重引用符で括る)で定義されます;
-            文字列の行列は通常の定数行列として定義されます.
-        </para>
-        <para>
-            文字列の結合は<literal>+</literal>操作により行われます.
-        </para>
-        <para>
+        <warning>
             複素数, 実数, 整数, 多項式行列の場合,
             <function>string</function> の出力は
             <link linkend="format">format</link> function (例参照)で管理されます.
-        </para>
+        </warning>
         <para>
             string([]) は []を返すことに注意してください.
         </para>
         <title>例</title>
         <programlisting role="example"><![CDATA[
             string(rand(2, 2))
+
             deff("y = mymacro(x)", "y = x + 1")
             [out, in, text] = string(mymacro)
             x = 123.356;
             disp("Result is " + string(x));
+
             disp("/" + string(~%t) + "/");
             disp("/" + string(%i+1) + "/");
             disp("/" + string(int16(-123)) + "/");
             disp("/" + string(1 + %s + %s^3) + "/");
+
             string(corelib)
+
             v = format();
             disp(string(%pi))
             format(24);
             disp(string(%pi))
             format(v(2))
+
             string(1:4:$)
  ]]></programlisting>
     </refsection>
         <title>参照</title>
         <simplelist type="inline">
             <member>
-                <link linkend="part">part</link>
-            </member>
-            <member>
-                <link linkend="length">length</link>
+                <link linkend="format">format</link>
             </member>
             <member>
-                <link linkend="quote">quote</link>
+                <link linkend="sci2exp">sci2exp</link>
             </member>
             <member>
-                <link linkend="evstr">evstr</link>
+                <link linkend="msprintf">msprintf</link>
             </member>
             <member>
-                <link linkend="execstr">execstr</link>
+                <link linkend="tree2code">tree2code</link>
             </member>
             <member>
-                <link linkend="strsubst">strsubst</link>
+                <link linkend="pol2str">pol2str</link>
             </member>
             <member>
-                <link linkend="strcat">strcat</link>
+                <link linkend="execstr">execstr</link>
             </member>
             <member>
-                <link linkend="strindex">strindex</link>
+                <link linkend="evstr">evstr</link>
             </member>
             <member>
-                <link linkend="sci2exp">sci2exp</link>
+                <link linkend="strtod">strtod</link>
             </member>
             <member>
-                <link linkend="format">format</link>
+                <link linkend="csvTextScan">csvTextScan</link>
             </member>
         </simplelist>
     </refsection>
index 4fd96ec..df2636f 100644 (file)
@@ -2,8 +2,8 @@
 <!--
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA -
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="pt">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns3="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="pt">
     <refnamediv>
         <refname>string</refname>
         <refpurpose>conversão para string (cadeia de caracteres)</refpurpose>
     </refnamediv>
     <refsynopsisdiv>
         <title>Seqüência de Chamamento</title>
-        <synopsis>string(x)
-            [out, in, text] = string(x)
+        <synopsis>
+            text = string(x)
+            [out, in, text] = string(SciFun)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
                     <para>matriz de reais ou função</para>
                 </listitem>
             </varlistentry>
+            <varlistentry>
+                <term>SciFun</term>
+                <listitem>
+                    <para>
+                        a function in Scilab language (handle of type 13, not its name as a string).
+                    </para>
+                </listitem>
+            </varlistentry>
         </variablelist>
     </refsection>
     <refsection>
         <title>Descrição</title>
         <para>Converte uma matriz em uma matriz de strings.</para>
         <para>
-            Se <literal>x</literal> é uma função <literal>[out, in, text] =
-                string(x)
-            </literal>
+            Se <varname>SciFun</varname> é uma função <literal>[out, in, text] = string(x)</literal>
             retorna três vetores de strings :
-            <literal>out</literal> é o vetor de variáveis de saída,
-            <literal>in</literal> é o vetor de variáveis de entrada, e
-            <literal>text</literal> é o vetor (coluna) do código fonte da
-            função.
+            <itemizedlist>
+                <listitem>
+                    <varname>out</varname> é o vetor de variáveis de saída,
+                </listitem>
+                <listitem>
+                    <varname>in</varname> é o vetor de variáveis de entrada, e
+                </listitem>
+                <listitem>
+                    <varname>text</varname>  é o vetor (coluna) do código fonte da função.
+                </listitem>
+            </itemizedlist>
         </para>
         <para>
-            Se <literal>x</literal> é uma variável <literal>lib</literal>
+            Se <varname>x</varname> é uma variável <literal>lib</literal>
             (bibiloteca), text é um vetor coluna de strings. O primeiro elemento
             contém o endereço do arquivo biblioteca e o outro o nome da função que ela
             define.
         </para>
+        <warning>
+            For any complex, real, integer, polynomial or rational input, the format of literal
+            numbers output from <function>string(..)</function> is managed by the
+            <link linkend="format">format</link> function (see examples).
+        </warning>
         <para>
-            Strings são definidos como <literal>'string'</literal> (entre aspas
-            simples) ou <literal>"string"</literal> (entre aspas duplas); matrizes de
-            strings são definidas como matrizes de constantes.
-        </para>
-        <para>Concatenação de strings é feita pela operação
-            <literal>+</literal>.
+            Note that string([]) returns [] (unchanged).
         </para>
     </refsection>
     <refsection>
         <title>Exemplos</title>
-        <programlisting role="example">string(rand(2, 2))
+        <programlisting role="example">
+            string(rand(2, 2))
 
             deff("y = mymacro(x)", "y = x + 1")
             [out, in, text] = string(mymacro)
             format(24);
             disp(string(%pi))
             format(v(2))
+
+            string(1:4:$)
         </programlisting>
     </refsection>
     <refsection role="see also">
         <title>Ver Também</title>
         <simplelist type="inline">
             <member>
-                <link linkend="part">part</link>
-            </member>
-            <member>
-                <link linkend="length">length</link>
+                <link linkend="format">format</link>
             </member>
             <member>
-                <link linkend="quote">quote</link>
+                <link linkend="sci2exp">sci2exp</link>
             </member>
             <member>
-                <link linkend="evstr">evstr</link>
+                <link linkend="msprintf">msprintf</link>
             </member>
             <member>
-                <link linkend="execstr">execstr</link>
+                <link linkend="tree2code">tree2code</link>
             </member>
             <member>
-                <link linkend="strsubst">strsubst</link>
+                <link linkend="pol2str">pol2str</link>
             </member>
             <member>
-                <link linkend="strcat">strcat</link>
+                <link linkend="execstr">execstr</link>
             </member>
             <member>
-                <link linkend="strindex">strindex</link>
+                <link linkend="evstr">evstr</link>
             </member>
             <member>
-                <link linkend="sci2exp">sci2exp</link>
+                <link linkend="strtod">strtod</link>
             </member>
             <member>
-                <link linkend="format">format</link>
+                <link linkend="csvTextScan">csvTextScan</link>
             </member>
         </simplelist>
     </refsection>
+    <refsection>
+        <title>Histórico</title>
+        <revhistory>
+            <revision>
+                <revnumber>5.4.0</revnumber>
+                <revremark>
+                    implicitlist typeof input accepted.
+                </revremark>
+            </revision>
+        </revhistory>
+    </refsection>
 </refentry>
index f05757f..db500c1 100644 (file)
@@ -3,8 +3,8 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) INRIA -
  * Copyright (C) DIGITEO - 2012 - Allan CORNET
- *
  * Copyright (C) 2012 - 2016 - Scilab Enterprises
+ * Copyright (C) 2019 - Samuel GOUGEON
  *
  * This file is hereby licensed under the terms of the GNU GPL v2.0,
  * pursuant to article 5.3.4 of the CeCILL v.2.1.
  * along with this program.
  *
  -->
-<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="ru">
+<refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
+          xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns4="http://www.w3.org/1999/xhtml"
+          xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
+          xmlns:scilab="http://www.scilab.org" xml:id="string" xml:lang="ru">
     <refnamediv>
         <refname>string</refname>
         <refpurpose>преобразование в строку</refpurpose>
@@ -22,8 +25,8 @@
     <refsynopsisdiv>
         <title>Синтаксис</title>
         <synopsis>
-            string(x)
-            [out, in, text] = string(x)
+            text = string(x)
+            [out, in, text] = string(SciFun)
         </synopsis>
     </refsynopsisdiv>
     <refsection>
                 <term>x</term>
                 <listitem>
                     <para>
-                        булева, комплексная, вещественная, целочисленная, полиномиальная матрица, неявный размер, библиотека или функция.
+                        булева, комплексная, вещественная, целочисленная, полиномиальная матрица,
+                        неявный размер, библиотека или функция.
+                    </para>
+                </listitem>
+            </varlistentry>
+            <varlistentry>
+                <term>SciFun</term>
+                <listitem>
+                    <para>
+                        a function in Scilab language (handle of type 13, not its name as a string).
                     </para>
                 </listitem>
             </varlistentry>
             <varname>x</varname> в матрицу строк.
         </para>
         <para>
-            Если <varname>x</varname> является функцией, то <code>[out, in, text] = string(x)</code> возвращает три вектора строк: <varname>out</varname> - вектор выходных переменных, <varname>in</varname> - вектор входных переменных, а <varname>text</varname> - вектор (вектор-столбец) исходного кода функции.
+            Если <varname>SciFun</varname> является функцией,
+            то <literal>[out, in, text] = string(SciFun)</literal> возвращает три вектора строк:
+            <itemizedlist>
+                <listitem>
+                    <varname>out</varname> - вектор выходных переменных,
+                </listitem>
+                <listitem>
+                    <varname>in</varname> - вектор входных переменных, а
+                </listitem>
+                <listitem>
+                    <varname>text</varname> - вектор (вектор-столбец) исходного кода функции.
+                </listitem>
+            </itemizedlist>
         </para>
         <para>
             Если <varname>x</varname> является переменной типа
             путь до файла библиотеки, а другой - имя функций, которые она
             определяет.
         </para>
-        <para>
-            Символьные строки определяются как <literal>'строка'</literal>
-            (между одинарными кавычками) или <literal>"строка"</literal> (между
-            двойными кавычками); матрицы строк определяются как обычные матрицы констант.
-        </para>
-        <para>
-            Связка строк выполняется с помощью операции <literal>+</literal>.
-        </para>
-        <para>
+        <warning>
             Для комплексной, вещественной, целочисленной, полиномиальной
             матрицы вывод функции <function>string</function> управляется с
             помощью функции <link linkend="format">format</link> (см. примеры).
+        </warning>
+        <para>
+            Note that string([]) returns [] (unchanged).
         </para>
     </refsection>
     <refsection>
             format(24);
             disp(string(%pi))
             format(v(2))
+
             string(1:4:$)
         </programlisting>
     </refsection>
         <title>Смотрите также</title>
         <simplelist type="inline">
             <member>
-                <link linkend="part">part</link>
-            </member>
-            <member>
-                <link linkend="length">length</link>
+                <link linkend="format">format</link>
             </member>
             <member>
-                <link linkend="quote">кавычка</link>
+                <link linkend="sci2exp">sci2exp</link>
             </member>
             <member>
-                <link linkend="evstr">evstr</link>
+                <link linkend="msprintf">msprintf</link>
             </member>
             <member>
-                <link linkend="execstr">execstr</link>
+                <link linkend="tree2code">tree2code</link>
             </member>
             <member>
-                <link linkend="strsubst">strsubst</link>
+                <link linkend="pol2str">pol2str</link>
             </member>
             <member>
-                <link linkend="strcat">strcat</link>
+                <link linkend="execstr">execstr</link>
             </member>
             <member>
-                <link linkend="strindex">strindex</link>
+                <link linkend="evstr">evstr</link>
             </member>
             <member>
-                <link linkend="sci2exp">sci2exp</link>
+                <link linkend="strtod">strtod</link>
             </member>
             <member>
-                <link linkend="format">format</link>
+                <link linkend="csvTextScan">csvTextScan</link>
             </member>
         </simplelist>
     </refsection>
             <revision>
                 <revnumber>5.4.0</revnumber>
                 <revremark>
-                    implicit size type managed as input argument.
+                    implicitlist typeof input accepted.
                 </revremark>
             </revision>
         </revhistory>