1 <?xml version="1.0" encoding="UTF-8"?>
3 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4 * Copyright (C) 2011 - DIGITEO - Michael Baudin
5 * Copyright (C) 2012 - 2016 - Scilab Enterprises
6 * Copyright (C) 2020 - Samuel GOUGEON
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.
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="complex" xml:lang="ja">
21 <refname>complex</refname>
22 <refpurpose>複素数を計算する</refpurpose>
37 scalars, vectors, matrices or hypermatrices of real numbers.
38 If both <varname>a</varname> and <varname>b</varname> are not
39 scalars, they must have the same sizes.
46 array of complex numbers, of the size of <varname>u</varname> or of
47 <varname>a</varname> and <varname>b</varname>.
48 If <varname>u</varname> is sparse, or if <varname>a</varname> and
49 <varname>b</varname> have the same sizes and both are sparse,
50 then <varname>c</varname> is also sparse.
51 Otherwise <varname>c</varname> is dense-encoded.
60 <emphasis role="bold">c = complex(u)</emphasis> は, <varname>u</varname>を実部,
64 <emphasis role="bold">c = complex(a,b)</emphasis> は実部<varname>a</varname> ,
65 虚部<varname>b</varname>の複素数を作成します.
68 This function is equivalent to <literal>a + imult(b)</literal>, which
69 handles properly special Inf and NaN real and imaginary parts.
75 以下の例では,実部と虚部から複素数を生成します.
77 <programlisting role="example"><![CDATA[
82 <varname>a</varname> のみが指定された場合, 虚部は0に設定されます.
84 <programlisting role="example"><![CDATA[
88 <varname>a</varname> がスカラーで <varname>b</varname> が
89 行列の場合, 結果 <varname>c</varname> は,
90 <varname>b</varname>と同じ大きさとなります.
91 同様に, <varname>b</varname> がスカラーで <varname>a</varname>
92 が行列の場合, 結果 <varname>c</varname> は
93 <varname>a</varname>と同じ大きさになります.
95 <programlisting role="example"><![CDATA[
96 c = complex([1 2 3], 4)
97 c = complex(1, [2 3 4])
100 <varname>a</varname> と <varname>b</varname> が
101 異なる大きさの行列の場合,以下のセッションのような
105 -->complex(ones(2,3),ones(4,5))
107 complex: Incompatible input arguments #1 and #2: Same sizes expected.
108 at line 33 of function complex called by :
109 complex(ones(2,3),ones(4,5))
112 With special real or/and imaginary parts:
114 <programlisting role="example"><![CDATA[
115 r = [0 0 0 %inf %inf %inf %nan %nan %nan].';
116 i = [0 %inf %nan 0 %inf %nan 0 %inf %nan].';
119 // Then let's compare complex(r, i) with r + i*%i :
120 [complex(r,i), r+i*%i]
135 // Then let's compare complex(r, i) with r + i*%i :
136 --> [complex(r,i), r+i*%i]
142 Inf + Infi Nan + Infi
143 Inf + Nani Nan + Nani
145 Nan + Infi Nan + Infi
146 Nan + Nani Nan + Nani
149 <refsection role="see also">
151 <simplelist type="inline">
153 <link linkend="percenti">%i</link>
156 <link linkend="imult">imult</link>
160 <refsection role="history">
164 <revnumber>6.1.1</revnumber>
165 <revdescription>Extension to sparse arrays.