a6861cf5192231b650a9a2b09e767baad3a1a7c3
[scilab.git] / scilab / modules / data_structures / help / en_US / typeof.xml
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  * 
6  * This file must be used under the terms of the CeCILL.
7  * This source file is licensed as described in the file COPYING, which
8  * you should have received as part of this distribution.  The terms
9  * are also available at    
10  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
11  *
12  -->
13 <refentry xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:svg="http://www.w3.org/2000/svg" xmlns:ns5="http://www.w3.org/1999/xhtml" xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="typeof" xml:lang="en">
14     <refnamediv>
15         <refname>typeof</refname>
16         <refpurpose>object type</refpurpose>
17     </refnamediv>
18     <refsynopsisdiv>
19         <title>Calling Sequence</title>
20         <synopsis>[t]=typeof(object)</synopsis>
21     </refsynopsisdiv>
22     <refsection>
23         <title>Arguments</title>
24         <variablelist>
25             <varlistentry>
26                 <term>object</term>
27                 <listitem>
28                     <para>Scilab object</para>
29                 </listitem>
30             </varlistentry>
31             <varlistentry>
32                 <term>t</term>
33                 <listitem>
34                     <para>string</para>
35                 </listitem>
36             </varlistentry>
37         </variablelist>
38     </refsection>
39     <refsection>
40         <title>Description</title>
41         <para>
42             <literal>t=typeof(object)</literal> returns one of the following
43             strings:
44         </para>
45         <variablelist>
46             <varlistentry>
47                 <term>"constant"</term>
48                 <listitem>
49                     <para>if object is a real or complex matrix of double.</para>
50                 </listitem>
51             </varlistentry>
52             <varlistentry>
53                 <term>"polynomial"</term>
54                 <listitem>
55                     <para>
56                         if object is a <link linkend="poly">polynomial matrix</link>.
57                     </para>
58                 </listitem>
59             </varlistentry>
60             <varlistentry>
61                 <term>"function"</term>
62                 <listitem>
63                     <para>
64                         if object is a <link linkend="function">function</link> (Scilab code). See also <link linkend="deff">deff</link>.
65                     </para>
66                 </listitem>
67             </varlistentry>
68             <varlistentry>
69                 <term>"handle"</term>
70                 <listitem>
71                     <para>
72                         if object is an <link linkend="graphics_entities">handle</link>.
73                     </para>
74                 </listitem>
75             </varlistentry>
76             <varlistentry>
77                 <term>"string"</term>
78                 <listitem>
79                     <para>
80                         if object is a matrix made of <link linkend="strings">character strings</link>.
81                     </para>
82                 </listitem>
83             </varlistentry>
84             <varlistentry>
85                 <term>"boolean"</term>
86                 <listitem>
87                     <para>
88                         if object is a <link linkend="matrices">boolean matrix</link>.
89                     </para>
90                 </listitem>
91             </varlistentry>
92             <varlistentry>
93                 <term>"list"</term>
94                 <listitem>
95                     <para>
96                         if object is a <link linkend="list">list</link>.
97                     </para>
98                 </listitem>
99             </varlistentry>
100             <varlistentry>
101                 <term>"rational"</term>
102                 <listitem>
103                     <para>
104                         if object is a <link linkend="rational">rational matrix</link> (transfer matrix).
105                     </para>
106                 </listitem>
107             </varlistentry>
108             <varlistentry>
109                 <term>"state-space"</term>
110                 <listitem>
111                     <para>
112                         if object is a state-space model (see <link linkend="syslin">syslin</link>).
113                     </para>
114                 </listitem>
115             </varlistentry>
116             <varlistentry>
117                 <term>"sparse"</term>
118                 <listitem>
119                     <para>
120                         if object is a (real) <link linkend="sparse">sparse matrix</link>.
121                     </para>
122                 </listitem>
123             </varlistentry>
124             <varlistentry>
125                 <term>"boolean sparse"</term>
126                 <listitem>
127                     <para>
128                         if object is a <link linkend="sparse">boolean sparse matrix</link>.
129                     </para>
130                 </listitem>
131             </varlistentry>
132             <varlistentry>
133                 <term>"hypermat"</term>
134                 <listitem>
135                     <para>
136                         if object is an <link linkend="hypermatrices">hypermatrix</link> (N-dimension array with N
137                         &gt;=3).
138                     </para>
139                 </listitem>
140             </varlistentry>
141             <varlistentry>
142                 <term>"st"</term>
143                 <listitem>
144                     <para>
145                         if object is a <link linkend="struct">structure</link>.
146                     </para>
147                 </listitem>
148             </varlistentry>
149             <varlistentry>
150                 <term>"ce"</term>
151                 <listitem>
152                     <para>
153                         if object is a <link linkend="cell">cell</link> array.
154                     </para>
155                 </listitem>
156             </varlistentry>
157             <varlistentry>
158                 <term>"fptr"</term>
159                 <listitem>
160                     <para>if object is a built-in Scilab function, called also gateway (C, C++ or Fortran code).</para>
161                 </listitem>
162             </varlistentry>
163             <varlistentry>
164                 <term>"pointer"</term>
165                 <listitem>
166                     <para>
167                         if object is a pointer (See a use case: <link linkend="lufact">lufact</link>).
168                     </para>
169                 </listitem>
170             </varlistentry>
171             <varlistentry>
172                 <term>"size implicit"</term>
173                 <listitem>
174                     <para>if object is a size implicit polynomial used for indexing. This a purely internal value.</para>
175                 </listitem>
176             </varlistentry>
177             <varlistentry>
178                 <term>"library"</term>
179                 <listitem>
180                     <para>if object is function library.</para>
181                 </listitem>
182             </varlistentry>
183             <varlistentry>
184                 <term>"int8" or "uint8" or "int16" or "uint16" or "int32" or "uint32"</term>
185                 <listitem>
186                     <para>
187                         if object is a matrix of [unsigned] integers stored on 8, 16 or 32 bits. (See <link linkend="int8">int</link>)
188                     </para>
189                 </listitem>
190             </varlistentry>
191         </variablelist>
192         <para>
193             Note that if the object is a <link linkend="tlist">tlist</link> or <link linkend="mlist">mlist</link>, typeof will return the first string in the first list entry
194         </para>
195     </refsection>
196     <refsection>
197         <title>Examples</title>
198         <programlisting role="example"><![CDATA[ 
199 typeof(1)
200 typeof(poly(0,'x'))
201
202 typeof(1/poly(0,'x'))
203 typeof(%t)
204
205 w=sprand(100,100,0.001);
206 typeof(w)
207 typeof(w==w)
208
209 deff('y=f(x)','y=2*x');
210 typeof(f)
211
212 L=tlist(['V','a','b'],18,'Scilab');
213 typeof(L)
214
215 typeof(corelib)
216  ]]></programlisting>
217     </refsection>
218     <refsection role="see also">
219         <title>See Also</title>
220         <simplelist type="inline">
221             <member>
222                 <link linkend="type">type</link>
223             </member>
224             <member>
225                 <link linkend="strings">strings</link>
226             </member>
227             <member>
228                 <link linkend="syslin">syslin</link>
229             </member>
230             <member>
231                 <link linkend="poly">poly</link>
232             </member>
233         </simplelist>
234     </refsection>
235 </refentry>