2d9ffda62f5a81dd2dd60d9258638c934049e10a
[scilab.git] / scilab / modules / elementary_functions / help / en_US / searchandsort / vectorfind.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 - Serge STEER
5  * Copyright (C) 2008 - INRIA - Ramine NIKOUKHAH
6  * Copyright (C) 2010 - DIGITEO - Vincent COUVERT
7  *
8  * Copyright (C) 2012 - 2016 - Scilab Enterprises
9  *
10  * This file is hereby licensed under the terms of the GNU GPL v2.0,
11  * pursuant to article 5.3.4 of the CeCILL v.2.1.
12  * This file was originally licensed under the terms of the CeCILL v2.1,
13  * and continues to be available under such terms.
14  * For more information, see the COPYING file which you should have received
15  * along with this program.
16  *
17  -->
18 <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="vectorfind" xml:lang="en">
19     <refnamediv>
20         <refname>vectorfind</refname>
21         <refpurpose>finds in a matrix rows or columns matching a vector</refpurpose>
22     </refnamediv>
23     <refsynopsisdiv>
24         <title>Syntax</title>
25         <synopsis>ind = vectorfind(m,v[,job])</synopsis>
26     </refsynopsisdiv>
27     <refsection>
28         <title>Arguments</title>
29         <variablelist>
30             <varlistentry>
31                 <term>m</term>
32                 <listitem>
33                     <para>a matrix of any type (the same type as v).</para>
34                 </listitem>
35             </varlistentry>
36             <varlistentry>
37                 <term>v</term>
38                 <listitem>
39                     <para>a vector of any type (the same type as m).</para>
40                 </listitem>
41             </varlistentry>
42             <varlistentry>
43                 <term>job</term>
44                 <listitem>
45                     <para>A character string: optional flag with possible values "r" to look for matching rows
46                         or "c" to look for matching columns. Default value is "r".
47                     </para>
48                 </listitem>
49             </varlistentry>
50             <varlistentry>
51                 <term>ind</term>
52                 <listitem>
53                     <para>row vector containing indices of matching rows or columns</para>
54                 </listitem>
55             </varlistentry>
56         </variablelist>
57     </refsection>
58     <refsection>
59         <title>Description</title>
60         <para>Finds in a matrix rows or columns matching a vector.</para>
61     </refsection>
62     <refsection>
63         <title>Examples</title>
64         <programlisting role="example"><![CDATA[
65 alr=[1,2,2;
66      1,2,1;
67      1,1,2;
68      1,1,1;
69      1,2,1];
70
71 ind = vectorfind(alr,[1,2,1],'r')
72 ind = vectorfind(string(alr),string([1,2,1]),'r')
73  ]]></programlisting>
74     </refsection>
75     <refsection role="see also">
76         <title>See also</title>
77         <simplelist type="inline">
78             <member>
79                 <link linkend="find">find</link>
80             </member>
81             <member>
82                 <link linkend="gsort">gsort</link>
83             </member>
84         </simplelist>
85     </refsection>
86 </refentry>