cedc0c1c8aa84410de99ac657445093a0e42702f
[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>Scilab object</para>
18                 </listitem>
19             </varlistentry>
20             <varlistentry>
21                 <term>i</term>
22                 <listitem>
23                     <para>integer</para>
24                 </listitem>
25             </varlistentry>
26         </variablelist>
27     </refsection>
28     <refsection>
29         <title>Description</title>
30         <para>
31             <literal>type(x)</literal>  returns an integer which is the type of <literal>x</literal> as following:
32         </para>
33         <variablelist>
34             <varlistentry>
35                 <term>1</term>
36                 <listitem>
37                     <para>real or complex matrix of double.</para>
38                 </listitem>
39             </varlistentry>
40             <varlistentry>
41                 <term>2</term>
42                 <listitem>
43                     <para>
44                         <link linkend="poly">polynomial matrix</link>.
45                     </para>
46                 </listitem>
47             </varlistentry>
48             <varlistentry>
49                 <term>4</term>
50                 <listitem>
51                     <para>
52                         <link linkend="matrices">boolean matrix</link>.
53                     </para>
54                 </listitem>
55             </varlistentry>
56             <varlistentry>
57                 <term>5</term>
58                 <listitem>
59                     <para>
60                         <link linkend="sparse">sparse matrix</link>.
61                     </para>
62                 </listitem>
63             </varlistentry>
64             <varlistentry>
65                 <term>6</term>
66                 <listitem>
67                     <para>
68                         <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                         matrix of <link linkend="int8">integers</link> stored on 1 (int8), 2 (int16) or 4 (int32) bytes.
83                     </para>
84                 </listitem>
85             </varlistentry>
86             <varlistentry>
87                 <term>9</term>
88                 <listitem>
89                     <para>
90                         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                         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                         un-compiled function (Scilab code). Function created with <link linkend="deff">deff</link> with argument 'n'.
107                     </para>
108                 </listitem>
109             </varlistentry>
110             <varlistentry>
111                 <term>13</term>
112                 <listitem>
113                     <para>
114                         compiled <link linkend="function">function</link> (Scilab code).
115                     </para>
116                 </listitem>
117             </varlistentry>
118             <varlistentry>
119                 <term>14</term>
120                 <listitem>
121                     <para>function library.</para>
122                 </listitem>
123             </varlistentry>
124             <varlistentry>
125                 <term>15</term>
126                 <listitem>
127                     <para>
128                         <link linkend="list">list</link>.
129                     </para>
130                 </listitem>
131             </varlistentry>
132             <varlistentry>
133                 <term>16</term>
134                 <listitem>
135                     <para>
136                         typed list (<link linkend="tlist">tlist</link>).
137                     </para>
138                 </listitem>
139             </varlistentry>
140             <varlistentry>
141                 <term>17</term>
142                 <listitem>
143                     <para>
144                         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                         pointer (Use case: <link linkend="lufact">lufact</link>).
153                     </para>
154                 </listitem>
155             </varlistentry>
156             <varlistentry>
157                 <term>129</term>
158                 <listitem>
159                     <para>size implicit polynomial used for indexing.</para>
160                 </listitem>
161             </varlistentry>
162             <varlistentry>
163                 <term>130</term>
164                 <listitem>
165                     <para>built-in Scilab function, called also gateway (C,
166                         C++ or Fortran code).
167                     </para>
168                 </listitem>
169             </varlistentry>
170             <varlistentry>
171                 <term>0</term>
172                 <listitem>
173                     <para>null variable. It is mainly used internally by
174                         Scilab. If a function has no declared returned argument
175                         like <literal>disp</literal> 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                         <literal>foo(a,,b)</literal> the missing argument is
179                         assigned to a null variable.
180                     </para>
181                     <para>
182                         Note that is a null variable is assigned to a name, it is removed.
183                         <literal>x=disp(1)</literal> deletes <literal>x</literal> 
184                     </para>
185                 </listitem>
186             </varlistentry>
187         </variablelist>
188         <para>Please note that, for some variables, type will return tlist
189             or mlist due to the internal data structure. This is the case of
190             <emphasis role="italic">rational</emphasis>, <emphasis role="italic">state-space</emphasis>, <emphasis role="italic">hypermat</emphasis> and <emphasis role="italic">struct</emphasis>. Please considering the use of
191             <link linkend="typeof">typeof</link> instead.
192         </para>
193     </refsection>
194     <refsection role="see also">
195         <title>See Also</title>
196         <simplelist type="inline">
197             <member>
198                 <link linkend="typeof">typeof</link>
199             </member>
200             <member>
201                 <link linkend="inttype">inttype</link>
202             </member>
203         </simplelist>
204     </refsection>
205 </refentry>