* Bug 16365 fixed: median(m,'r'|'c') was wrong after 5dc990
[scilab.git] / scilab / modules / elementary_functions / help / ja_JP / matrixmanipulation / matrix.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) - INRIA
5  * Copyright (C) 2017 - Samuel GOUGEON
6  *
7  * Copyright (C) 2012 - 2016 - Scilab Enterprises
8  *
9  * This file is hereby licensed under the terms of the GNU GPL v2.0,
10  * pursuant to article 5.3.4 of the CeCILL v.2.1.
11  * This file was originally licensed under the terms of the CeCILL v2.1,
12  * and continues to be available under such terms.
13  * For more information, see the COPYING file which you should have received
14  * along with this program.
15  *
16  -->
17 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"
18           xmlns:svg="http://www.w3.org/2000/svg" xmlns:mml="http://www.w3.org/1998/Math/MathML"
19           xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org"
20           xml:lang="ja" xml:id="matrix">
21     <refnamediv>
22         <refname>matrix</refname>
23         <refpurpose>ベクトルまたは行列を異なる大きさの行列に成形する</refpurpose>
24     </refnamediv>
25     <refsynopsisdiv>
26         <title>呼び出し手順</title>
27         <synopsis>
28             y = matrix(v, m, n)
29             y = matrix(v, m1, m2, m3, ..)
30             y = matrix(v, [sizes])
31         </synopsis>
32     </refsynopsisdiv>
33     <refsection>
34         <title>引数</title>
35         <variablelist>
36             <varlistentry>
37                 <term>v</term>
38                 <listitem>
39                     <para>ベクトル, 行列またはハイパー行列</para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>n, m, m1, m2, ..</term>
44                 <listitem>
45                     <para>整数</para>
46                 </listitem>
47             </varlistentry>
48             <varlistentry>
49                 <term>sizes</term>
50                 <listitem>
51                     <para>整数ベクトル</para>
52                 </listitem>
53             </varlistentry>
54             <varlistentry>
55                 <term>y</term>
56                 <listitem>
57                     <para>ベクトル, 行列またはハイパー行列</para>
58                 </listitem>
59             </varlistentry>
60         </variablelist>
61     </refsection>
62     <refsection>
63         <title>説明</title>
64         <para>
65             <literal>n</literal> x <literal>m</literal>個のエントリを有する
66             ベクトルまたは行列の場合,
67             コマンド <literal>y=matrix(v,n,m)</literal> または同様な
68             <literal>y=matrix(v,[n,m])</literal> は
69             <literal>v</literal> ベクトル(または行列)を,
70             <literal>v</literal>のエントリを列方向でスタックすることにより
71             <literal>nxm</literal> の行列に変換します.
72         </para>
73         <para>
74             m または nの次元の一つが -1 に等しい場合,もう一つの次元で
75             size(v,'*')を割った数が自動的に代入されます.
76         </para>
77         <para>
78             <literal>prod(size(v))==prod(sizes)</literal>のようなハイパー行列の場合,
79             コマンド <literal>y=matrix(v,sizes)</literal> (または
80             等価な <literal>y=matrix(v,n1,n2,...nm)</literal>) は,
81             <literal>v</literal>のエントリを
82             "列方向"(つまり,最初の次元が最初に変わる)にスタックする
83             ことにより<literal>v</literal> を行列またはハイパー行列に変換します.
84             <literal>y=matrix(v,sizes)</literal>
85             は,sizes がスカラーまたは2要素のベクトルの場合,通常の行列となります.
86         </para>
87         <note>
88             <itemizedlist>
89                 <listitem>
90                     <literal>y = v(:)</literal> is equivalent to <literal>matrix(v,-1, 1)</literal>
91                 </listitem>
92                 <listitem>
93                     <literal>matrix()</literal> can be overloaded for any mlist() type, with a
94                     function named <literal>%&lt;type>_matrix(v,s,..)</literal> with at least 2
95                     input arguments.
96                 </listitem>
97             </itemizedlist>
98         </note>
99     </refsection>
100     <refsection>
101         <title>例</title>
102         <para><emphasis role="bold">With a regular matrix of decimal numbers:</emphasis></para>
103         <programlisting role="example"><![CDATA[
104 a = [1 3 5 7 9 11; 2 4 6 8 10 12]
105 matrix(a, 4, 3)
106 matrix(a, [3 4])
107 matrix(a, 3, -1)
108 // into an hypermatrix:
109 matrix(a, 3, 2, 2)
110  ]]></programlisting>
111     <para>
112         <emphasis role="bold">With texts:</emphasis>
113     </para>
114         <programlisting role="example"><![CDATA[
115 t = strsplit("a":"x",1:23)'
116 matrix(t,[3,8])
117  ]]></programlisting>
118     <screen><![CDATA[
119 --> t = strsplit("a":"x",1:23)'
120  t  =
121 !a  b  c  d  e  f  g  h  i  j  k  l  m  n  o  p  q  r  s  t  u  v  w  x  !
122
123 --> matrix(t,[3,8])
124  ans  =
125 !a  d  g  j  m  p  s  v  !
126 !b  e  h  k  n  q  t  w  !
127 !c  f  i  l  o  r  u  x  !
128 ]]></screen>
129     <para>
130         <emphasis role="bold">With a cells hyperarray:</emphasis>
131     </para>
132         <programlisting role="example"><![CDATA[
133 c = makecell([2,3,2], %t,%z, %i,"abc", list(%pi,"a"), int8(23),cos,sind,"àèìòù",corelib, 0.5, 1/%z^2)
134 rc = matrix(c, 3, 4)
135 rc(8)==c(8)
136 rc{8}.getshell
137  ]]></programlisting>
138     <screen><![CDATA[
139  c  =
140 (:,:,1)
141   [1x1 boolean]  [1x1 polynomial]  [1x1 constant]
142   [1x1 string ]  [    list      ]  [1x1 int8    ]
143 (:,:,2)
144   [      1 fptr   ]  [      1 function]  [1x1 string]
145   [        library]  [    1x1 constant]  [    r     ]
146
147 --> rc = matrix(c, 3, 4)
148  rc  =
149   [1x1 boolean   ]  [    list    ]  [      1 fptr    ]  [1x1 constant]
150   [1x1 string    ]  [1x1 constant]  [        library ]  [1x1 string  ]
151   [1x1 polynomial]  [1x1 int8    ]  [      1 function]  [    r       ]
152
153 --> rc(8)==c(8)
154  ans  =
155   T
156
157 --> rc{8}.getshell
158  ans  =
159  cmd
160 ]]></screen>
161     <para>
162         <emphasis role="bold">With a structures array:</emphasis>
163     </para>
164         <programlisting role="example"><![CDATA[
165 clear s
166 s(3,6).r = %pi
167 matrix(s,2,9)
168  ]]></programlisting>
169     <screen><![CDATA[
170 --> s(3,6).r = %pi
171  s  =
172   3x6 struct array with fields:
173     r
174
175 --> matrix(s,2,9)
176  ans  =
177   2x9 struct array with fields:
178     r
179 ]]></screen>
180     </refsection>
181     <refsection role="see also">
182         <title>参照</title>
183         <simplelist type="inline">
184             <member>
185                 <link linkend="colon">colon (:)</link>
186             </member>
187             <member>
188                 <link linkend="resize_matrix">resize_matrix</link>
189             </member>
190             <member>
191                 <link linkend="ndims">ndims</link>
192             </member>
193             <member>
194                 <link linkend="size">size</link>
195             </member>
196             <member>
197                 <link linkend="extraction">extraction</link>
198             </member>
199             <member>
200                 <link linkend="quote">transposition</link>
201             </member>
202             <member>
203                 <link linkend="brackets">brackets [..]</link>
204             </member>
205             <member>
206                 <link linkend="matrices">matrices</link>
207             </member>
208             <member>
209                 <link linkend="hypermatrices">hypermatrices</link>
210             </member>
211             <member>
212                 <link linkend="makecell">makecell</link>
213             </member>
214             <member>
215                 <link linkend="struct">struct</link>
216             </member>
217             <member>
218                 <link linkend="mlist">mlist</link>
219             </member>
220         </simplelist>
221     </refsection>
222 </refentry>