[doc] mv data_structures/types => core/types
[scilab.git] / scilab / modules / core / help / en_US / types / hypermatrices.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2007-2008 - INRIA
5  *
6  * Copyright (C) 2012 - 2016 - Scilab Enterprises
7  *
8  * This file is hereby licensed under the terms of the GNU GPL v2.0,
9  * pursuant to article 5.3.4 of the CeCILL v.2.1.
10  * This file was originally licensed under the terms of the CeCILL v2.1,
11  * and continues to be available under such terms.
12  * For more information, see the COPYING file which you should have received
13  * along with this program.
14  *
15  -->
16 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:lang="en" xml:id="hypermatrices">
17     <refnamediv>
18         <refname>hypermatrices</refname>
19         <refpurpose>a Scilab object, N dimensional matrix in Scilab</refpurpose>
20     </refnamediv>
21     <refsection>
22         <title>Description</title>
23         <para>
24             Hypermatrix type allows to manipulate multidimensional arrays.
25         </para>
26         <para>
27             They can be defined by extension of 2D matrices as follows
28             <code>a=[1 2;3 4];a(:,:,2)=rand(2,2)</code> or directly using <function>matrix</function> function.
29         </para>
30         <para>
31             Entries can be booleans, encoded integers of any inttype, real or complex numbers,
32             polynomials, rationals, strings, booleans.
33         </para>
34         <para>
35             <note>
36                 The number of dimension of hypermatrices with right-most sizes equal to
37                 1 are automatically reduced. An hypermatrix with only two dimensions is
38                 automatically changed to a regular matrix (type 1).
39             </note>
40         </para>
41     </refsection>
42     <refsection>
43         <title>Examples</title>
44         <programlisting role="example"><![CDATA[
45 a(1,1,1,1:2)=[1 2]
46 a=[1 2;3 4];a(:,:,2)=rand(2,2)
47 a(1,1,:)
48
49 size(a)
50
51 a(:,:,1) //dimensionality reduction
52 type(a(:,:,1))
53
54 [a a]
55  ]]></programlisting>
56     </refsection>
57     <refsection role="see also">
58         <title>See also</title>
59         <simplelist type="inline">
60             <member>
61                 <link linkend="zeros">zeros</link>
62             </member>
63             <member>
64                 <link linkend="ones">ones</link>
65             </member>
66             <member>
67                 <link linkend="grand">grand</link>
68             </member>
69             <member>
70                 <link linkend="matrix">matrix</link>
71             </member>
72         </simplelist>
73     </refsection>
74 </refentry>