1
subroutine intex11f(fname)
3
c -----------------------------------
4
c Executing the Scilab function "myfct" defined in ex11f.sce
6
logical getrhsvar, scistring
7
logical checklhs,checkrhs
14
if(.not.checkrhs(fname,minrhs,maxrhs)) return
15
if(.not.checklhs(fname,minlhs,maxlhs)) return
17
if(.not.getrhsvar(1,'d',m1,n1,l1)) return
18
if(.not.getrhsvar(2,'d',m2,n2,l2)) return
19
if(.not.getrhsvar(3,'d',m2,n2,l2)) return
20
if(.not.getrhsvar(4,'d',m2,n2,l2)) return
21
if(.not.getrhsvar(5,'d',m2,n2,l2)) return
22
if(.not.getrhsvar(6,'d',m2,n2,l2)) return
24
c We receive 6 input variables indexed by (1,2,...6)
25
c when the command ex11f(x1,x2,x3,x4,x5,x6) is issued.
27
c We have a Scilab function "myfct" with mrhs=2 inputs
30
c function [u,v,w]=myfct(x,y)','u=7+x,v=8+y,w=9+y')
31
c To run myfct with input variables x5 and x6,
32
c we must set ifirst=5. Variables passed to the function must
33
c appear consecutively with index ifirst, ifirst+1,..., ifirst+mrhs.
37
c Variables #5 (x5) and #6 (x6) are the two inputs (x,y above) of "myfct",
38
c i.e. myfct(x5,x6) is executed now:
39
if(.not.scistring(ifirst,'myfct',mlhs,mrhs)) return
41
c Output variables u, v, and w of myfct
42
c are now indexed by ifirst, ifirst+1, ifirst+mlhs i.e.
43
c u and v are indexed by 5 and 6 resp. and w (created by myfct)
45
c We return u v and w:
46
c Caution: Variables with index larger than ifirst+mrhs cannot be