Revision of help pages of module "data_structures" (en_US, ru_RU).
[scilab.git] / scilab / modules / data_structures / help / en_US / type.xml
1 <?xml version="1.0" encoding="UTF-8"?>
2 <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="type">
3     <refnamediv>
4         <refname>type</refname>
5         <refpurpose>returns the type of a variable</refpurpose>
6     </refnamediv>
7     <refsynopsisdiv>
8         <title>Calling Sequence</title>
9         <synopsis>[i]=type(x)</synopsis>
10     </refsynopsisdiv>
11     <refsection>
12         <title>Arguments</title>
13         <variablelist>
14             <varlistentry>
15                 <term>x</term>
16                 <listitem>
17                     <para>a Scilab object.</para>
18                 </listitem>
19             </varlistentry>
20             <varlistentry>
21                 <term>i</term>
22                 <listitem>
23                     <para>an integer.</para>
24                 </listitem>
25             </varlistentry>
26         </variablelist>
27     </refsection>
28     <refsection>
29         <title>Description</title>
30         <para>
31             <code>type(x)</code>  returns an integer which is the type of <varname>x</varname> as following:
32         </para>
33         <variablelist>
34             <varlistentry>
35                 <term>1</term>
36                 <listitem>
37                     <para>a real or complex matrix of double.</para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>2</term>
42                 <listitem>
43                     <para>
44                         a <link linkend="poly">polynomial matrix</link>.
45                     </para>
46                 </listitem>
47             </varlistentry>
48             <varlistentry>
49                 <term>4</term>
50                 <listitem>
51                     <para>
52                         a <link linkend="matrices">boolean matrix</link>.
53                     </para>
54                 </listitem>
55             </varlistentry>
56             <varlistentry>
57                 <term>5</term>
58                 <listitem>
59                     <para>
60                         a <link linkend="sparse">sparse matrix</link>.
61                     </para>
62                 </listitem>
63             </varlistentry>
64             <varlistentry>
65                 <term>6</term>
66                 <listitem>
67                     <para>
68                         a <link linkend="sparse">sparse boolean matrix</link>.
69                     </para>
70                 </listitem>
71             </varlistentry>
72             <varlistentry>
73                 <term>7</term>
74                 <listitem>
75                     <para>Matlab sparse matrix</para>
76                 </listitem>
77             </varlistentry>
78             <varlistentry>
79                 <term>8</term>
80                 <listitem>
81                     <para>
82                         a matrix of <link linkend="int8">integers</link> stored on 1 (<literal>int8</literal>), 2 (<literal>int16</literal>) or 4 (<literal>int32</literal>) bytes.
83                     </para>
84                 </listitem>
85             </varlistentry>
86             <varlistentry>
87                 <term>9</term>
88                 <listitem>
89                     <para>
90                         a matrix of <link linkend="graphics_entities">graphic handles</link>.
91                     </para>
92                 </listitem>
93             </varlistentry>
94             <varlistentry>
95                 <term>10</term>
96                 <listitem>
97                     <para>
98                         a matrix of <link linkend="strings">character strings</link>.
99                     </para>
100                 </listitem>
101             </varlistentry>
102             <varlistentry>
103                 <term>11</term>
104                 <listitem>
105                     <para>
106                         an un-compiled function (Scilab code). A function created with <link linkend="deff">deff</link> with argument <literal>'n'</literal>.
107                     </para>
108                 </listitem>
109             </varlistentry>
110             <varlistentry>
111                 <term>13</term>
112                 <listitem>
113                     <para>
114                         a compiled <link linkend="function">function</link> (Scilab code).
115                     </para>
116                 </listitem>
117             </varlistentry>
118             <varlistentry>
119                 <term>14</term>
120                 <listitem>
121                     <para>a function <link linkend="library">library</link>.</para>
122                 </listitem>
123             </varlistentry>
124             <varlistentry>
125                 <term>15</term>
126                 <listitem>
127                     <para>
128                         a <link linkend="list">list</link>.
129                     </para>
130                 </listitem>
131             </varlistentry>
132             <varlistentry>
133                 <term>16</term>
134                 <listitem>
135                     <para>
136                         a typed list (<link linkend="tlist">tlist</link>).
137                     </para>
138                 </listitem>
139             </varlistentry>
140             <varlistentry>
141                 <term>17</term>
142                 <listitem>
143                     <para>
144                         a matrix oriented typed list (<link linkend="mlist">mlist</link>).
145                     </para>
146                 </listitem>
147             </varlistentry>
148             <varlistentry>
149                 <term>128</term>
150                 <listitem>
151                     <para>
152                         a pointer (Use case: <link linkend="lufact">lufact</link>).
153                     </para>
154                 </listitem>
155             </varlistentry>
156             <varlistentry>
157                 <term>129</term>
158                 <listitem>
159                     <para>a size implicit polynomial used for indexing.</para>
160                 </listitem>
161             </varlistentry>
162             <varlistentry>
163                 <term>130</term>
164                 <listitem>
165                     <para>
166                       a built-in Scilab function, called also <emphasis role="italic">gateway</emphasis> (C, C++ or Fortran code).
167                     </para>
168                 </listitem>
169             </varlistentry>
170             <varlistentry>
171                 <term>0</term>
172                 <listitem>
173                     <para>a null variable. It is mainly used internally by
174                         Scilab. If a function has no declared returned argument
175                         like <function>disp</function> when it is called it returns
176                         a null variable. If a function is called with an omitted
177                         argument in the argument list like
178                         <code>foo(a,,b)</code> the missing argument is
179                         assigned to a null variable.
180                     </para>
181                     <para>
182                       <note>
183                         Note that if a null variable is assigned to a name, it is removed.
184                         <code>x=disp(1)</code> deletes <literal>x</literal>.
185                       </note>
186                     </para>
187                 </listitem>
188             </varlistentry>
189         </variablelist>
190         <para>
191           <note>
192             Please note that, for some variables, <function>type</function> will return <literal>tlist</literal>
193             or <literal>mlist</literal> due to the internal data structure. This is the case of
194             <emphasis role="italic">rational</emphasis> and <emphasis role="italic">state-space</emphasis> matrices, <emphasis role="italic">hypermat</emphasis> and <emphasis role="italic">struct</emphasis>. Please considering the use of
195             <link linkend="typeof">typeof</link> instead.
196           </note>
197         </para>
198     </refsection>
199     <refsection role="see also">
200         <title>See Also</title>
201         <simplelist type="inline">
202             <member>
203                 <link linkend="typeof">typeof</link>
204             </member>
205             <member>
206                 <link linkend="inttype">inttype</link>
207             </member>
208         </simplelist>
209     </refsection>
210 </refentry>