93c8c421859c25be39829f13d7f379971021ab42
[scilab.git] / scilab / modules / elementary_functions / help / en_US / matrixmanipulation / repmat.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) 2011 - INRIA - Serge Steer
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-en.txt
11  *
12  -->
13 <refentry version="5.0-subset Scilab" xml:id="repmat" xml:lang="en"
14           xmlns="http://docbook.org/ns/docbook"
15           xmlns:xlink="http://www.w3.org/1999/xlink"
16           xmlns:svg="http://www.w3.org/2000/svg"
17           xmlns:ns5="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML"
19           xmlns:db="http://docbook.org/ns/docbook">
20   <info>
21     <pubdate>$LastChangedDate: 2011-01-12  (mer, 12 jan 2011)
22     $</pubdate>
23   </info>
24
25   <refnamediv>
26     <refname>repmat</refname>
27
28     <refpurpose>Replicate and tile an array</refpurpose>
29   </refnamediv>
30
31   <refsynopsisdiv>
32     <title>Calling Sequence</title>
33
34     <synopsis>B = repmat(A,m,n,...)</synopsis>
35     <synopsis>B = repmat(A,siz)</synopsis>
36     <synopsis>B = repmat(A,m)</synopsis>
37   </refsynopsisdiv>
38
39   <refsection>
40     <title>Arguments</title>
41
42     <variablelist>
43       <varlistentry>
44         <term>A</term>
45
46         <listitem>
47           <para>input 2D array.</para>
48         </listitem>
49       </varlistentry>
50
51       <varlistentry>
52         <term>m, n, ...</term>
53         <listitem>
54           <para>integers, number of <literal>A</literal> blocks for
55           each dimension of <literal>B</literal>.</para>
56         </listitem>
57       </varlistentry>
58
59       <varlistentry>
60         <term>siz</term>
61
62         <listitem>
63           <para>vector of integer, each element gives the number of
64           <literal>A</literal> blocks for corresponding dimension of
65           <literal>B</literal>.</para>
66         </listitem>
67       </varlistentry>
68
69
70       <varlistentry>
71         <term>B</term> 
72
73         <listitem>
74           <para>resulting array form by tiling the <literal>A</literal> 2D array.</para>
75         </listitem>
76       </varlistentry>
77     </variablelist>
78   </refsection>
79
80   <refsection>
81     <title>Description</title>
82
83     <para><literal>repmat(A,m,n)</literal> or similarily
84     <literal>repmat(A,[m,n])</literal> returns a large matrix
85     consisting of an <literal>m</literal>-by- <literal>n</literal>
86     tiling of copies of <literal>A</literal>. The size of the result
87     is <literal>[size(A,1)*M, size(A,2)*N]</literal>.</para>
88
89     <para><literal>repmat(A,m)</literal> creates an
90     <literal>m</literal>-by- <literal>m</literal>tiling.</para>
91
92
93     <para><literal>repmat(A,[m n p ...])</literal> tiles the array A to produce a 
94     multidimensional array  composed of copies of  <literal>A</literal>. The size of the result is 
95     <literal>[size(A,1)*M, size(A,2)*N, size(A,3)*P, ...] </literal></para>.
96
97
98     <para>For now,only arrays of real, integer, boolean, character
99     string, polynomial and rational as well as sparse matrices are
100     supported. This function definition can be extended using
101     overloading mechanism.</para>
102   </refsection>
103
104   <refsection>
105     <title>Examples</title>
106
107     <programlisting role="example"><![CDATA[ 
108     repmat(1:3,2,2)
109     repmat(int8([1 0 1;0 1 0]),2,3,2)
110     repmat("Scilab",3,2)
111     t="Scilab";t(ones(3,2))
112     repmat([1/%s;2/(%s+1)],1,3)
113
114  ]]></programlisting>
115   </refsection>
116
117   <refsection>
118     <title>See Also</title>
119
120     <simplelist type="inline">
121       <member><link linkend="matrix">matrix</link></member>
122
123       <member><link linkend="extraction">extraction</link></member>
124
125       <member><link linkend="size">size</link></member>
126     </simplelist>
127   </refsection>
128
129   <refsection>
130     <title>Authors</title>
131
132     <para>Serge Steer, INRIA</para>
133   </refsection>
134 </refentry>