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
5 * Copyright (C) 2015 - Samuel GOUGEON
6 * Copyright (C) 2012 - 2016 - Scilab Enterprises
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" 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="en" xml:id="real">
17    <refnamediv>
18        <refname>real</refname>
19        <refpurpose>real part of complex numbers, polynomials, or rationals</refpurpose>
20    </refnamediv>
21    <refsynopsisdiv>
22        <title>Syntax</title>
23        <synopsis>y = real(x)</synopsis>
24    </refsynopsisdiv>
25    <refsection role="parameters">
26        <title>Arguments</title>
27        <variablelist>
28            <varlistentry>
29                <term>x</term>
30                <listitem>
31                    <para>matrix of real or complex numbers (full or sparse storage),
32                    or of polynomials or rationals with real or complex coefficients.</para>
33                </listitem>
34            </varlistentry>
35            <varlistentry>
36                <term>y</term>
37                <listitem>
38                    <para>matrix of real numbers, polynomials or rationals, with same sizes than <varname>x</varname>.
39                    </para>
40                </listitem>
41            </varlistentry>
42        </variablelist>
43    </refsection>
44    <refsection role="description">
45        <title>Description</title>
46        <para>
47            <code>real(x)</code> components are the real part of related <varname>x</varname>
48            components (See <constant>%i</constant> to enter complex numbers).
49        </para>
50    </refsection>
51    <refsection role="examples">
52        <title>Examples</title>
53        <programlisting role="example"><![CDATA[
54real([1 %i 2])
55real(1+0*%i)
56real(2+3*%i)
57real(1+%s)
58real(sprand(3,3,0.1))
59
60// With polynomials:
61A = [1-%i*%z (%z-%i)^2]
62real(A)
63
64// With rationals:
65A = [ %z/(1-%z)  (1-%z)/%z^2];
66B = A(1,[2 1])
67C = A + %i*B
68A, real(C)
69 ]]></programlisting>
70    </refsection>
71
72    <refsection role="see also">
73        <title>See also</title>
74        <simplelist type="inline">
75            <member>
76                <link linkend="imag">imag</link>
77            </member>
78        </simplelist>
79    </refsection>
80    <refsection role="history">
81        <title>History</title>
82        <revhistory>
83            <revision>
84                <revnumber>6.0</revnumber>
85                <revdescription>Extension to rationals
86                </revdescription>
87            </revision>
88        </revhistory>
89    </refsection>
90</refentry>
91
92