73fca9975b3af0e7b0bfb83309859ccd7a672585
[scilab.git] / scilab / modules / m2sci / help / en_US / m2sci_equivalents / i / isa.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) 2009 - DIGITEO - Vincent COUVERT
5  *
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:id="m2sci_isa">
17     <refnamediv>
18         <refname>isa (Matlab function)</refname>
19         <refpurpose>Detect an object of a given type</refpurpose>
20     </refnamediv>
21     <refsection>
22         <title>Matlab/Scilab equivalent</title>
23         <para>
24             There is no equivalent function for Matlab <emphasis role="strong">isa</emphasis>
25             function in Scilab but it can be replaced by equivalent syntaxes as shown is examples.
26         </para>
27         <table>
28             <caption/>
29             <tbody>
30                 <tr>
31                     <td>
32                         <para>
33                             <emphasis role="strong">Equivalence table</emphasis>
34                         </para>
35                     </td>
36                 </tr>
37                 <tr>
38                     <td>
39                         <para> Matlab </para>
40                     </td>
41                     <td>
42                         <para> Scilab </para>
43                     </td>
44                 </tr>
45                 <tr>
46                     <td>
47                         <para> a = isa(x,"logical") </para>
48                     </td>
49                     <td>
50                         <para>a = type(x)==4; </para>
51                     </td>
52                 </tr>
53                 <tr>
54                     <td>
55                         <para> b = isa(x,"char") </para>
56                     </td>
57                     <td>
58                         <para>b = type(x)==10; </para>
59                     </td>
60                 </tr>
61                 <tr>
62                     <td>
63                         <para> c = isa(x,"numeric") </para>
64                     </td>
65                     <td>
66                         <para>c = or(type(x)==[1,5,8]); </para>
67                     </td>
68                 </tr>
69                 <tr>
70                     <td>
71                         <para> d = isa(x,"int8") </para>
72                     </td>
73                     <td>
74                         <para>d = typeof(x)=='int8'; </para>
75                     </td>
76                 </tr>
77                 <tr>
78                     <td>
79                         <para> e = isa(x,"uint8") </para>
80                     </td>
81                     <td>
82                         <para>e = typeof(x)=='uint8'; </para>
83                     </td>
84                 </tr>
85                 <tr>
86                     <td>
87                         <para> f = isa(x,"int16") </para>
88                     </td>
89                     <td>
90                         <para>f = typeof(x)=="int16"; </para>
91                     </td>
92                 </tr>
93                 <tr>
94                     <td>
95                         <para> g = isa(x,"uint16") </para>
96                     </td>
97                     <td>
98                         <para>g = typeof(x)=="uint16"; </para>
99                     </td>
100                 </tr>
101                 <tr>
102                     <td>
103                         <para> h = isa(x,"int32") </para>
104                     </td>
105                     <td>
106                         <para>h = typeof(x)=="int32"; </para>
107                     </td>
108                 </tr>
109                 <tr>
110                     <td>
111                         <para> k = isa(x,"uint32") </para>
112                     </td>
113                     <td>
114                         <para>k = typeof(x)=="uint32"; </para>
115                     </td>
116                 </tr>
117                 <tr>
118                     <td>
119                         <para> l = isa(x,"single") </para>
120                     </td>
121                     <td>
122                         <para>l = type(x)==1; </para>
123                     </td>
124                 </tr>
125                 <tr>
126                     <td>
127                         <para> m = isa(x,"double") </para>
128                     </td>
129                     <td>
130                         <para>m = type(x)==1; </para>
131                     </td>
132                 </tr>
133                 <tr>
134                     <td>
135                         <para> n = isa(x,"cell") </para>
136                     </td>
137                     <td>
138                         <para>n = typeof(x)=="ce"; </para>
139                     </td>
140                 </tr>
141                 <tr>
142                     <td>
143                         <para> o = isa(x,"struct") </para>
144                     </td>
145                     <td>
146                         <para>o = typeof(x)=="st"; </para>
147                     </td>
148                 </tr>
149                 <tr>
150                     <td>
151                         <para> p = isa(x,"function_handle") </para>
152                     </td>
153                     <td>
154                         <para>p = type(x)==13; </para>
155                     </td>
156                 </tr>
157                 <tr>
158                     <td>
159                         <para> q = isa(x,"sparse") </para>
160                     </td>
161                     <td>
162                         <para>q = type(x)==5; </para>
163                     </td>
164                 </tr>
165                 <tr>
166                     <td>
167                         <para> r = isa(x,"lti") </para>
168                     </td>
169                     <td>
170                         <para>r = typeof(x)=="state-space"; </para>
171                     </td>
172                 </tr>
173             </tbody>
174         </table>
175     </refsection>
176 </refentry>