13
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" version="5.0-subset Scilab" xml:lang="en" xml:id="mtlb_sort">
15
<refname>mtlb_sort</refname>
16
<refpurpose>Matlab sort emulation
21
<title>Calling Sequence</title>
22
<synopsis>P = mtlb_sort(X)
23
P = mtlb_sort(X,dim[,mode])
27
<title>Arguments</title>
32
<para>a scalar, vector, matrix of reals, booleans or a string</para>
40
<para>a positive scalar integer</para>
46
<para>a string ("ascend" or "descend")</para>
52
<title>Description</title>
54
Matlab <literal>sort</literal> and Scilab <literal>gsort</literal> behave
55
differently in some particular cases:
60
For a vector <literal>X</literal> the Matlab
61
<literal>sort(X,'g','i')</literal> function call is equivalent to the
62
Scilab <literal>gsort(X)</literal> function call.
67
The value <literal>1</literal> (resp. <literal>2</literal>) of the Matlab
68
dim is equivalent to the Scilab <literal>"r"</literal> flag (resp.
69
<literal>"c"</literal>).
74
The Matlab "<literal>ascend"</literal> (resp.
75
<literal>"descend"</literal>) mode is equivalent to the Scilab
76
<literal>"i"</literal> (resp. <literal>"d"</literal>) flag.
81
The function <literal>mtlb_sort(X[,dim[,mode]])</literal> is used by
82
<literal>mfile2sci</literal> to replace <literal>sort(X[,dim[,mode]])</literal> when
83
it was not possible to know what were the inputs while porting Matlab code
84
to Scilab. This function will determine the correct semantic at run time.
85
If you want to have a more efficient code it is possible to replace
86
<literal>mtlb_sort</literal> call by <link linkend="gsort">gsort</link> call.
89
Caution: <literal>mtlb_sort</literal> has not to be used for hand coded
15
<refname>mtlb_sort</refname>
16
<refpurpose>Matlab sort emulation
21
<title>Calling Sequence</title>
22
<synopsis>P = mtlb_sort(X)
23
P = mtlb_sort(X,dim[,mode])
27
<title>Arguments</title>
32
<para>a scalar, vector, matrix of reals, booleans or a string</para>
40
<para>a positive scalar integer</para>
46
<para>a string ("ascend" or "descend")</para>
52
<title>Description</title>
54
Matlab <literal>sort</literal> and Scilab <literal>gsort</literal> behave
55
differently in some particular cases:
60
For a vector <literal>X</literal> the Matlab
61
<literal>sort(X,'g','i')</literal> function call is equivalent to the
62
Scilab <literal>gsort(X)</literal> function call.
67
The value <literal>1</literal> (resp. <literal>2</literal>) of the Matlab
68
dim is equivalent to the Scilab <literal>"r"</literal> flag (resp.
69
<literal>"c"</literal>).
74
The Matlab "<literal>ascend"</literal> (resp.
75
<literal>"descend"</literal>) mode is equivalent to the Scilab
76
<literal>"i"</literal> (resp. <literal>"d"</literal>) flag.
81
The function <literal>mtlb_sort(X[,dim[,mode]])</literal> is used by
82
<literal>mfile2sci</literal> to replace <literal>sort(X[,dim[,mode]])</literal> when
83
it was not possible to know what were the inputs while porting Matlab code
84
to Scilab. This function will determine the correct semantic at run time.
85
If you want to have a more efficient code it is possible to replace
86
<literal>mtlb_sort</literal> call by <link linkend="gsort">gsort</link> call.
89
Caution: <literal>mtlb_sort</literal> has not to be used for hand coded