1
function [tree]=%i2sci_r(tree)
4
// Conversion function for Matlab insertion in row vectors (called by %i2sci())
5
// Input: tree = Matlab operation tree
6
// Output: tree = Scilab equivalent for tree
12
if from.dims(1)==1 & from.dims(2)==1 then // Insert a scalar
13
elseif from.dims(1)==1 then // Insert a row vector
14
elseif from.dims(1)<>Unknown & from.dims(2)<>Unknown then // Insert a matrix with known sizes
15
tree.operands($)=Funcall("matrix",1,Rhs(from,1,Operation("-",list(Cste(1)),list())))
17
if ~isdefinedvar(from) then
19
insert(Equal(list(w),from))
25
tmp=Operation("ext",list(w,Cste(":")),list())
26
tmp=Operation(".''",list(tmp),list())
30
tree.operands(2)=Cste(1)
34
tree.out(1).dims=list(1,Unknown)
35
tree.out(1).type=to.type