* Bug 7967 fixed [doc]: size(meshgrid(..)) better documented
[scilab.git] / scilab / modules / elementary_functions / help / ru_RU / elementarymatrices / meshgrid.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  * Copyright (C) 2012 - 2016 - Scilab Enterprises
6  * Copyright (C) 2020 - Samuel GOUGEON
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"
17           xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml"
18           xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook"
19           xmlns:scilab="http://www.scilab.org" xml:id="meshgrid" xml:lang="ru">
20     <refnamediv>
21         <refname>meshgrid</refname>
22         <refpurpose>создаёт матрицы или трёхмерные массивы</refpurpose>
23     </refnamediv>
24     <refsynopsisdiv>
25         <title>Синтаксис</title>
26         <synopsis>
27             U = meshgrid(u)
28             [U, V] = meshgrid(u)
29             [X, Y] = meshgrid(x, y)
30             [X, Y, Z] = meshgrid(x, y, z)
31         </synopsis>
32     </refsynopsisdiv>
33     <refsection>
34         <title>Аргументы</title>
35         <variablelist>
36             <varlistentry>
37                 <term>u, x, y, z</term>
38                 <listitem>
39                     vectors of any types, of lengths nu, nx, ny, nz.
40                     <para/>
41                 </listitem>
42             </varlistentry>
43             <varlistentry>
44                 <term>U, V</term>
45                 <listitem>
46                     Square matrices of size nu x nu
47                     <para/>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>X, Y, Z</term>
52                 <listitem>
53                     Matrices or hypermatrices of the same size
54                     [<emphasis role="bold">ny</emphasis>, nx] or
55                     [<emphasis role="bold">ny</emphasis>, nx, nz].
56                     <para/>
57                 </listitem>
58             </varlistentry>
59         </variablelist>
60     </refsection>
61     <refsection>
62         <title>Описание</title>
63         <para>
64             meshgrid(..) builds matrices or 3-D hypermatrices by replicating input vectors
65             along 2 or 3 dimensions.
66         </para>
67         <para>
68             <note>
69                 To create arrays of size [<emphasis role="bold">nx</emphasis>, ny] instead of
70                 [ny, nx], or with more than 3 dimensions, please use
71                 <literal>ndgrid(x, y)</literal> or <literal>ndgrid(x, y, z,..)</literal>.
72             </note>
73         </para>
74         <para>
75             <warning>
76                 Most of Scilab 2D or 3D graphical functions like <literal>champ()</literal>,
77                 <literal>grayplot()</literal>, <literal>Sgrayplot()</literal>,
78                 <literal>plot3d()</literal>, <literal>contour()</literal>, etc.. work with grids
79                 generated with <literal>ndgrid()</literal>, not from
80                 <literal>meshgrid()</literal>. Data computed on grids coming from
81                 <literal>meshgrid()</literal> will require being transposed (please see the
82                 example thereafter).
83             </warning>
84         </para>
85     </refsection>
86     <refsection>
87         <title>Примеры</title>
88         <programlisting role="example"><![CDATA[
89 [X, Y] = meshgrid(0:2)
90  ]]></programlisting>
91     <screen>
92 --> [X, Y] = meshgrid(0:2)
93  X  =
94    0.   1.   2.
95    0.   1.   2.
96    0.   1.   2.
97
98  Y  =
99    0.   0.   0.
100    1.   1.   1.
101    2.   2.   2.
102 </screen>
103         <para/>
104         <programlisting role="example"><![CDATA[
105 [X, Y] = meshgrid(["a" "bc" "αβγδ"], [-3 5])
106  ]]></programlisting>
107     <screen>
108 --> [X, Y] = meshgrid(["a" "bc" "αβγδ"], [-3 5])
109  X  =
110 !a  bc  αβγδ  !
111 !a  bc  αβγδ  !
112
113  Y  =
114   -3.  -3.  -3.
115    5.   5.   5.
116 </screen>
117         <para/>
118         <para>
119             Application to grids for graphics:
120         </para>
121         <programlisting role="example"><![CDATA[
122 // Generating data
123 x = -1:0.1:1.7;
124 y = -1:0.1:1;
125 [X, Y] = meshgrid(x, y);
126 Z = sinc(2*%pi * X.*Y);
127
128 // Setting the graphic figure
129 clf
130 drawlater
131 gcf().color_map = parulacolormap(64);
132 gcf().axes_size = [650 530];
133
134 // Plotting
135 subplot(2,2,1)
136 Sgrayplot(x, y, Z')
137 title(["Sgrayplot(x, y, Z'' ) " "$←\;Z^t\; required$"], "fontsize",3)
138 isoview, colorbar
139
140 subplot(2,2,2)
141 plot3d(x, y, Z', -125,50)
142 gce().color_flag = 1;
143 title(["plot3d(x, y, Z'' ) " "$←\;Z^t\; required$"], "fontsize",3)
144 isoview
145
146 subplot(2,2,3)
147 champ(x,y,sin(2*X'),cos(2*Y'))
148 title(["champ(x, y, sin(X'' ),cos(Y'' ))" "$←\;X^t\;\;Y^t\; required$"], "fontsize",3)
149 isoview
150
151 subplot(2,2,4)
152 surf(X, Y, Z)
153 title("surf(X, Y, Z)", "fontsize",3)
154 isoview
155
156 gcf().children.tight_limits = ["on" "on" "on"];
157 drawnow
158  ]]></programlisting>
159         <para/>
160         <scilab:image>
161             // Generating data
162             x = -1:0.1:1.7;
163             y = -1:0.1:1;
164             [X, Y] = meshgrid(x, y);
165             Z = sinc(2*%pi * X.*Y);
166
167             // Setting the graphic figure
168             clf
169             drawlater
170             gcf().color_map = parulacolormap(64);
171             gcf().axes_size = [650 530];
172
173             // Plotting
174             subplot(2,2,1)
175             Sgrayplot(x, y, Z')
176             title(["Sgrayplot(x, y, Z'' ) " "$←\;Z^t\; required$"], "fontsize",3)
177             isoview, colorbar
178
179             subplot(2,2,2)
180             plot3d(x, y, Z', -125,50)
181             gce().color_flag = 1;
182             title(["plot3d(x, y, Z'' ) " "$←\;Z^t\; required$"], "fontsize",3)
183             isoview
184
185             subplot(2,2,3)
186             champ(x,y,sin(2*X'),cos(2*Y'))
187             title(["champ(x, y, sin(X'' ),cos(Y'' ))" "$←\;X^t\;\;Y^t\; required$"], "fontsize",3)
188             isoview
189
190             subplot(2,2,4)
191             surf(X, Y, Z)
192             title("surf(X, Y, Z)", "fontsize",3)
193             isoview
194
195             gcf().children.tight_limits = ["on" "on" "on"];
196             drawnow
197         </scilab:image>
198     </refsection>
199     <refsection role="see also">
200         <title>Смотрите также</title>
201         <simplelist type="inline">
202             <member>
203                 <link linkend="ndgrid">ndgrid</link>
204             </member>
205             <member>
206                 <link linkend="repmat">repmat</link>
207             </member>
208             <member>
209                 <link linkend="feval">feval</link>
210             </member>
211         </simplelist>
212     </refsection>
213 </refentry>