function [out1,out2,out3]=modeldelay(t,x,flag,par) d=par(1); n=par(2); y=zeros(n+1,1); y(1)=sin(t); for i=2:(n+1) y(2*i-1)=0*n*(x(2*i-3)-x(2*i-1))/d; % righthand = 0 -- variable x(1) is not to be delay y(2*i)=+n*(x(2*i-2)-x(2*i))/d; end if nargin <3 | isempty(flag) out1=y; else switch(flag) case 'init' out1 = []; out2 = []; out3 = []; otherwise error(['Unknown flag''' flag ''.']) end end