1
function [tree]=sci_MFUN(tree)
2
// Prototype for cumsum and cumprod
5
// Conversion function for Matlab MFUN()
6
// Input: tree = Matlab funcall tree
7
// Ouput: tree = Scilab equivalent for tree
8
// Emulation function: mtlb_MFUN()
15
// Because %b_SFUN and %C_SFUN are not defined
19
dim=first_non_singleton(A)
21
tree.lhs(1).dims=A.dims
26
tree.rhs=Rhs(A,Funcall("firstnonsingleton",1,list(A),list()))
29
tree.lhs(1).type=Type(Double,Real)
31
tree.lhs(1).type=Type(Double,Unknown)
35
[A,dim] = getrhs(tree)
37
// Because %b_SFUN and %C_SFUN are not defined
39
dim=convert2double(dim)
42
if typeof(dim)=="cste" then
43
if dim.value>size(A.dims) then
44
if typeof(A)=="funcall" then
45
tree.lhs(1).infer=A.infer
47
elseif typeof(A)=="operation" then
48
tree.lhs(1).infer=A.infer
52
set_infos("Scilab SFUN() does not work when dim input argument is greater than number of dims of first rhs...",1)
58
tree.lhs(1).dims=A.dims
61
tree.lhs(1).type=Type(Double,Real)
63
tree.lhs(1).type=Type(Double,Unknown)