1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
4
<LANGUAGE>eng</LANGUAGE>
5
<TITLE>mtlb_find</TITLE>
6
<TYPE>M2SCI function</TYPE>
7
<DATE>April 2004</DATE>
9
<SHORT_DESCRIPTION name="mtlb_find">Matlab find emulation function</SHORT_DESCRIPTION>
13
<P>Matlab and Scilab <VERB>find</VERB> behave differently in some particular cases:</P>
20
With column vectors and matrices as input: Matlab <VERB>find</VERB> returns column
21
vectors while Scilab returns row vectors.
27
When called with three outputs: Matlab <VERB>find</VERB> can have three outputs but Scilab not.
35
The function <VERB>[i[,j[,v]]] = mtlb_find(B)</VERB> is used by
36
<VERB>mfile2sci</VERB> to replace <VERB>[i[,j[,v]]] = find(B)</VERB> when it was not
37
possible to know what was the input while porting Matlab code to Scilab. This function will
38
determine the correct semantic at run time. If you want to have a
39
more efficient code it is possible to replace <VERB>mtlb_find</VERB> calls:
47
When called with one output, if <VERB>B</VERB> is a row vector
48
<VERB>i = mtlb_find(B)</VERB> may be replaced by <VERB>i = find(B)</VERB>
54
When called with one output, if <VERB>B</VERB> is not a row vector
55
<VERB>i = mtlb_find(B)</VERB> may be replaced by <VERB>i = matrix(find(B),-1,1)</VERB>
61
When called with two outputs, if <VERB>B</VERB> is a row vector
62
<VERB>[i,j] = mtlb_find(B)</VERB> may be replaced by <VERB>[i,j] = find(B)</VERB>
68
When called with two outputs, if <VERB>B</VERB> is not a row vector
69
<VERB>[i,j] = mtlb_find(B)</VERB> may be replaced by
70
<VERB>[i,j] = find(B);i = matrix(i,-1,1);j = matrix(j,-1,1);</VERB>
77
<P>Caution: <VERB>mtlb_find</VERB> has not to be used for hand coded functions.</P>
82
<AUTHORS_ITEM>V.C.</AUTHORS_ITEM>