1
<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>
2
<!-- When this file is modified please also modify mtlb_min.xml -->
3
<!DOCTYPE MAN SYSTEM "../../manrev.dtd">
5
<LANGUAGE>eng</LANGUAGE>
6
<TITLE>mtlb_max</TITLE>
7
<TYPE>M2SCI function</TYPE>
8
<DATE>April 2004</DATE>
10
<SHORT_DESCRIPTION name="mtlb_max">Matlab max emulation function</SHORT_DESCRIPTION>
14
<P>Matlab and Scilab <VERB>max</VERB> behave differently in some particular cases:</P>
21
With complex values: Matlab <VERB>max</VERB> can be used with complex values but not Scilab function.
27
When called with one input: Matlab <VERB>max</VERB> threats values along the first
28
non-singleton dimension but Scilab threats all input values.
34
When called with two inputs: if one is an empty matrix, Scilab returns an error message but Matlab returns [].
40
When called with three inputs: if <VERB>dim</VERB> parameter is greater than number of
41
dimensions of first input, Scilab returns an error message and Matlab returns the first input.
49
The function <VERB>[r[,k]] = mtlb_max(A[,B[,dim]])</VERB> is used by
50
<VERB>mfile2sci</VERB> to replace <VERB>[r[,k]] = max(A[,B[,dim]])</VERB> when it was not
51
possible to know what were the inputs while porting Matlab code to Scilab. This function will
52
determine the correct semantic at run time. If you want to have a
53
more efficient code it is possible to replace <VERB>mtlb_max</VERB> calls:
61
When called with one input, if <VERB>A</VERB> is a vector or a scalar
62
<VERB>[r[,k]] = mtlb_max(A)</VERB> may be replaced by <VERB>max(A)</VERB>
68
When called with one input, if <VERB>A</VERB> is a matrix
69
<VERB>[r[,k]] = mtlb_max(A)</VERB> may be replaced by <VERB>max(A,"r")</VERB>
75
When called with two inputs, if <VERB>A</VERB> and <VERB>B</VERB> are real matrices and not empty matrices
76
<VERB>[r[,k]] = mtlb_max(A,B)</VERB> may be replaced by <VERB>max(A,B)</VERB>
82
When called with three inputs, if <VERB>dim</VERB> is lesser than the number of dimensions of <VERB>A</VERB>
83
<VERB>[r[,k]] = mtlb_max(A,[],dim)</VERB> may be replaced by <VERB>max(A,dim)</VERB>
90
<P>Caution: <VERB>mtlb_max</VERB> has not to be used for hand coded functions.</P>
95
<SEE_ALSO_ITEM> <LINK>firstnonsingleton</LINK> </SEE_ALSO_ITEM>
99
<AUTHORS_ITEM>V.C.</AUTHORS_ITEM>