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