samer@0: function u=construct(s,sizes_in) samer@0: samer@0: u=construct(s.base,sizes_in); samer@0: s0=u.get_state(); samer@0: u.sizes_out = [u.sizes_out,size(s0)]; samer@0: u.process = mkproc(u.process, nargout(s.base), ... samer@0: u.get_state,s.period); samer@0: end samer@0: samer@0: function f=mkproc(g,nout,getst,period) samer@0: k=1; samer@0: f=@proc_nnn; samer@0: samer@0: function varargout=proc_nnn(varargin) samer@0: varargout=cell(1,nout+1); samer@0: [varargout{1:nout}]=g(varargin{:}); samer@0: if k==1, samer@0: k=period; samer@0: varargout{nout+1}={getst()}; samer@0: else samer@0: k=k-1; samer@0: varargout{nout+1}={}; samer@0: end samer@0: end samer@0: end samer@0: