Elementary_functions: members() improved
[scilab.git] / scilab / modules / m2sci / help / en_US / m2sci_equivalents / i / ismember.xml
1 <?xml version="1.0" encoding="ISO-8859-1"?>
2 <!--
3  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
4  * Copyright (C) 2013 - Samuel GOUGEON
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.1-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:mml="http://www.w3.org/1998/Math/MathML" xmlns:db="http://docbook.org/ns/docbook" xmlns:scilab="http://www.scilab.org" xml:id="m2sci_ismember" xml:lang="en">
14     <refnamediv>
15         <refname>ismember (Matlab function)</refname>
16         <refpurpose>Data sets membership comparison</refpurpose>
17     </refnamediv>
18     <refsection>
19         <title>Matlab/Scilab equivalent</title>
20         <informaltable border="1" width="100%">
21             <tr>
22                 <td align="center">
23                     <emphasis role="bold">Matlab</emphasis>
24                 </td>
25                 <td align="center">
26                     <emphasis role="bold">Scilab</emphasis>
27                 </td>
28             </tr>
29             <tr>
30                 <td>
31                     <programlisting role="example"><![CDATA[
32 // a)
33 AinB = ismember(A, B)
34
35 // b)
36 [AinB, loc] = ismember(A, B)
37 // c)
38 [rAinB, loc] = ismember(A, B, 'rows')
39 ]]></programlisting>
40                 </td>
41                 <td>
42                     <programlisting role="example"><![CDATA[
43 // a)
44 mA = members(A, B);
45 AinB = bool2s(mA~=0)
46 // b)
47 [mA, loc] = members(A, B)
48 // c)
49 [rmA, loc] = members(A, B, "rows");
50 rAinB = bool2s(rmA~=0)
51 ]]></programlisting>
52                 </td>
53             </tr>
54         </informaltable>
55     </refsection>
56     <refsection>
57         <title>Description</title>
58         <para>
59             In addition, Scilab provides the number of occurrences, can provide the locations of last occurrences instead of the first ones, can process A and B column-wise, and can ignore the order of elements in each row/column to be detected (detection of permutations).
60         </para>
61     </refsection>
62 </refentry>