Re: [Scilab-users] mlist parameters to a function call

2016-01-23 Thread Samuel Gougeon

Le 23/01/2016 10:34, eddydde a écrit :

that's not the solution to my problem:

the last two function calls in which i use xa(1x11) as first argument and
three parameters (a1.a2,a3 or d.aa(1,:)) !

here i get an 11x1 result with the wrong(?) three parameters

When xa is a vector,  T is a vector in the function, and then the line
 t=x(1)-x(2)/(T+x(3))
performs a matricial division. If you want to perform a element-wise 
division, the syntax is

 t = x(1) - x(2) ./ (T+x(3)) // with ./ instead of /

Regards
Samuel Gougeon

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] mlist parameters to a function call

2016-01-23 Thread eddydde
that's not the solution to my problem: 

the last two function calls in which i use xa(1x11) as first argument and
three parameters (a1.a2,a3 or d.aa(1,:)) !

here i get an 11x1 result with the wrong(?) three parameters

Ed.



--
View this message in context: 
http://mailinglists.scilab.org/mlist-parameters-to-a-function-call-tp4033316p4033318.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] mlist parameters to a function call

2016-01-22 Thread Serge Steer

Le 23/01/2016 06:47, eddydde a écrit :

probably a newby question, but I can't get this right:

see example below, parameters for the function seem to get disordered


Any help would be welcome!

the instruction "return y" must be removed!
Serge


Ed

a1=4.6543
a2=1435.264
a3=-64.848
b=[4.6543,1435.264,-64.848]
c=[4.6543,1435.264,-64.848;
 1,2,3]
d.name='ed'
d.aa=c
disp(10^(a1-a2/(373.15+a3)))

function y=pv(T,x)
 t=x(1)-x(2)/(T+x(3))
 y=10^t
 disp(y)
 return y
endfunction

pv(373.15,[a1,a2,a3])
pv(373.15,b)
pv(373.15,c(1,:))
pv(373.15,c)
pv(373.15,d.aa(1,:))
xa=[273:10:373]
pv(xa(11),b)
pv(xa,[a1,a2,a3])
pv(xa,d.aa(1,:))




--
View this message in context: 
http://mailinglists.scilab.org/mlist-parameters-to-a-function-call-tp4033316.html
Sent from the Scilab users - Mailing Lists Archives mailing list archive at 
Nabble.com.
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users



___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users