next up previous contents
Next: 6. Conclusion Up: 5.2.2 Types of Computational Previous: 5.2.2.7 Example

5.2.2.8 Example

The advantage of coding inputs and outputs as lists is that the number of inputs and outputs need not be specified explicitly. In this example, the output is the element-wise product of all the input vectors, regardless of the number of inputs.

function [y,x,z,tvec,xd]=elemprod(flag,nevprt,t,x,z,rpar,ipar,u)
tvec=[];xd=[]
y=u(1)
for i=2:length(u)
   y=y.*u(i)
end
y=list(y)


next up previous contents
Next: 6. Conclusion Up: 5.2.2 Types of Computational Previous: 5.2.2.7 Example
Scilab Group