gschur() was declared obsolete in Scilab 4, now removed
[scilab.git] / scilab / modules / functions / help / ja_JP / function.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2
3 <!--
4  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
5  * Copyright (C) ????-2008 - INRIA
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
18 <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="ja" xml:id="function">
19     
20     <refnamediv>
21         
22         <refname>function</refname>
23         
24         <refpurpose>関数定義をオープンする</refpurpose>
25         
26     </refnamediv>
27     
28     <refnamediv xml:id="endfunction">
29         
30         <refname>endfunction</refname>
31         
32         <refpurpose>関数定義を閉じる</refpurpose>
33         
34     </refnamediv>
35     
36     <refsection>
37         
38         <title>説明</title>
39         
40         <programlisting role='no-scilab-exec'><![CDATA[
41 function <lhs_arguments>=<function_name><rhs_arguments>
42   <statements>
43 endfunction
44     ]]></programlisting>
45         
46         <para>
47             
48             ただし,
49             
50         </para>
51         
52         <variablelist>
53             
54             <varlistentry>
55                 
56                 <term>&lt;function_name&gt;</term>
57                 
58                 <listitem>
59                     
60                     <para>は関数の名前を意味します.</para>
61                     
62                 </listitem>
63                 
64             </varlistentry>
65             
66             <varlistentry>
67                 
68                 <term>&lt;rhs_arguments&gt;</term>
69                 
70                 <listitem>
71                     
72                     <para>は入力引数のリストを意味します.</para>
73                     
74                     <itemizedlist>
75                         
76                         <listitem>
77                             
78                             <para>
79                                 
80                                 <literal>(x1,...,xm)</literal>のように括弧で括った
81                                 
82                                 カンマ区切りの変数名の一覧となります.
83                                 
84                                 最後の変数名はキーワード<literal>varargin</literal>と
85                                 
86                                 することも可能です
87                                 
88                                 (<link linkend="varargin">varargin</link> 参照)
89                                 
90                             </para>
91                             
92                         </listitem>
93                         
94                         <listitem>
95                             
96                             <para>
97                                 
98                                 関数に入力引数がない場合, <literal>()</literal> または
99                                 
100                                 何も付けません.
101                                 
102                             </para>
103                             
104                         </listitem>
105                         
106                     </itemizedlist>
107                     
108                 </listitem>
109                 
110             </varlistentry>
111             
112             <varlistentry>
113                 
114                 <term>&lt;lhs_arguments&gt;</term>
115                 
116                 <listitem>
117                     
118                     <para>は出力引数のリストを意味します.</para>
119                     
120                     <itemizedlist>
121                         
122                         <listitem>
123                             
124                             <para>
125                                 
126                                 これは,<literal>[y1,...,yn]</literal>のように角括弧で括った
127                                 
128                                 カンマ区切りの変数名の一覧となります.
129                                 
130                                 最後の変数名はキーワード <literal>varargout</literal> 
131                                 
132                                 (<link linkend="varargout">varargout</link> 参照)とすること
133                                 
134                                 が可能です.
135                                 
136                             </para>
137                             
138                         </listitem>
139                         
140                         <listitem>
141                             
142                             <para>
143                                 
144                                 関数が出力引数を持たない場合,<literal>[]</literal> を指定します.
145                                 
146                                 この場合,構文を以下のようにすることも可能です:
147                                 
148                                 <literal>function &lt;function_name&gt;&lt;rhs_arguments&gt;</literal>
149                                 
150                             </para>
151                             
152                         </listitem>
153                         
154                     </itemizedlist>
155                     
156                 </listitem>
157                 
158             </varlistentry>
159             
160             <varlistentry>
161                 
162                 <term>&lt;statements&gt;</term>
163                 
164                 <listitem>
165                     
166                     <para>
167                         
168                         Scilab命令(ステートメント)の集合を意味します.
169                         
170                         この構文は,インラインまたはスクリプトファイル(exec 参照)の中で
171                         
172                         関数を定義する (<link linkend="functions">functions</link> 参照)ために使用できます.
173                         
174                         古いバージョンのScilabとの互換性のため,
175                         
176                         function 定義のみを含むスクリプトファイルで定義された関数は,
177                         
178                         <literal>exec</literal>関数によりScilabに"ロードする"ことができます.
179                         
180                     </para>
181                     
182                 </listitem>
183                 
184             </varlistentry>
185             
186         </variablelist>
187         
188         <para>
189             
190             <literal>function &lt;lhs_arguments&gt;=&lt;function_name&gt;&lt;rhs_arguments&gt;</literal>
191             
192             のシーケンスは複数の行に分割することができません.
193             
194             このシーケンスはカンマまたはセミコロンを終端に付けることにより,
195             
196             同じ行に命令を続けることができます.
197             
198         </para>
199         
200         <note>
201             
202             <literal>&lt;function_name&gt;</literal> は
203             
204             いくつかの構文規則に従う必要があることに注意してください
205             
206             (<link linkend="names">names</link>参照).
207             
208         </note>
209         
210         <para>
211             
212             function の定義はネストすることが可能です.
213             
214         </para>
215         
216     </refsection>
217     
218     <refsection>
219         
220         <title>例</title>
221         
222         <programlisting role="example"><![CDATA[
223 //インライン定義 (function参照)
224 function [x,y]=myfct(a,b)
225 x=a+b
226 y=a-b
227 endfunction
228
229 [x,y]=myfct(3,2)
230
231 //1行で関数定義
232 function y=sq(x),y=x^2,endfunction
233
234 sq(3)
235
236 //関数定義のネスト
237 function y=foo(x)
238 a=sin(x)
239 function y=sq(x), y=x^2,endfunction
240 y=sq(a)+1
241 endfunction
242
243 foo(%pi/3)
244
245 // スクリプトファイル内での定義 (exec参照)
246 exec SCI/modules/elementary_functions/macros/asinh.sci;
247  ]]></programlisting>
248         
249     </refsection>
250     
251     <refsection role="see also">
252         
253         <title>参照</title>
254         
255         <simplelist type="inline">
256             
257             <member>
258                 
259                 <link linkend="functions">functions</link>
260                 
261             </member>
262             
263             <member>
264                 
265                 <link linkend="exec">exec</link>
266                 
267             </member>
268             
269             <member>
270                 
271                 <link linkend="names">names</link>
272                 
273             </member>
274             
275         </simplelist>
276         
277     </refsection>
278     
279 </refentry>
280