* Bug #13409 fixed - permute(x, dims) failed when dims was greater than the dimension...
[scilab.git] / scilab / modules / elementary_functions / help / en_US / matrixmanipulation / permute.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) 2008 - INRIA - Farid BELAHCENE
5  *
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at
10  * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
11  *
12  -->
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns: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="permute" xml:lang="en">
14     <refnamediv>
15         <refname>permute</refname>
16         <refpurpose>permute the dimensions of an array</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>y=permute(x,dims)</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>dims</term>
27                 <listitem>
28                     <para>a scalar or a vector of positive reals.</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>x</term>
33                 <listitem>
34                     <para>a scalar, a vector, a matrix or a multi-array.</para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             Permutes the dimensions of an array according to <varname>dims</varname>.
43         </para>
44         <para>
45             Input argument <varname>dims</varname> must be a valid permutation where dimension <literal>#i</literal> becomes <literal>#dims(i)</literal>.
46         </para>
47     </refsection>
48     <refsection>
49         <title>Examples</title>
50         <programlisting role="example"><![CDATA[
51 //example 1:
52 x=[1 2 3;4 5 6]
53 y=permute(x,[2 1])
54
55 //example 2:
56 x=matrix(1:12,[2,3,2])
57 y=permute(x,[3 1 2])
58
59 x = matrix(1:12, [3 2 2])
60 y = permute(x, [3 4 1 2])
61 // Dimensions are changed according to dims
62 // #1=rows    becomes #3=pages
63 // #2=columns becomes #4=books
64 // #3=pages   becomes #1=rows
65 // #4=books   becomes #2=columns
66  ]]></programlisting>
67     </refsection>
68     <refsection role="see also">
69         <title>See Also</title>
70         <simplelist type="inline">
71             <member>
72                 <link linkend="pertrans">pertrans</link>
73             </member>
74             <member>
75                 <link linkend="quote">quote</link>
76             </member>
77             <member>
78                 <link linkend="cat">cat</link>
79             </member>
80         </simplelist>
81     </refsection>
82 </refentry>