next up previous contents
Next: 5.2.2.8 Example Up: 5.2.2 Types of Computational Previous: 5.2.2.6 Computational function type

5.2.2.7 Example

The following is the Computational function associated with a block that displays in a Scilab window, every time it receives an event, the number of events it has received up to the current time, and the values of its two inputs.
function [y,x,z,tvec,xd]=test(flag,nevprt,t,x,z,rpar,ipar,u)
y=list();tvec=[];xd=[]
if flag==4 then
    z=0
elseif flag==2 then
    z=z+1
    write(%io(2),'Number of calls:'+string(z))
    [u1,u2]=u(1:2)
    write(%io(2),'first input');disp(u1)
    write(%io(2),'second input');disp(u2)
end


next up previous contents
Next: 5.2.2.8 Example Up: 5.2.2 Types of Computational Previous: 5.2.2.6 Computational function type
Scilab Group