function [ret,x0,str,ts,xts]=simdemo(t,x,u,flag);
%SIMDEMO	is the M-file description of the SIMULINK system named SIMDEMO.
%	The block-diagram can be displayed by typing: SIMDEMO.
%
%	SYS=SIMDEMO(T,X,U,FLAG) returns depending on FLAG certain
%	system values given time point, T, current state vector, X,
%	and input vector, U.
%	FLAG is used to indicate the type of output to be returned in SYS.
%
%	Setting FLAG=1 causes SIMDEMO to return state derivatives, FLAG=2
%	discrete states, FLAG=3 system outputs and FLAG=4 next sample
%	time. For more information and other options see SFUNC.
%
%	Calling SIMDEMO with a FLAG of zero:
%	[SIZES]=SIMDEMO([],[],[],0),  returns a vector, SIZES, which
%	contains the sizes of the state vector and other parameters.
%		SIZES(1) number of states
%		SIZES(2) number of discrete states
%		SIZES(3) number of outputs
%		SIZES(4) number of inputs
%		SIZES(5) number of roots (currently unsupported)
%		SIZES(6) direct feedthrough flag
%		SIZES(7) number of sample times
%
%	For the definition of other parameters in SIZES, see SFUNC.
%	See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.

% Note: This M-file is only used for saving graphical information;
%       after the model is loaded into memory an internal model
%       representation is used.

% the system will take on the name of this mfile:
sys = mfilename;
new_system(sys)
simver(1.3)
if (0 == (nargin + nargout))
     set_param(sys,'Location',[15,89,499,498])
     open_system(sys)
end;
set_param(sys,'algorithm',     'RK-45')
set_param(sys,'Start time',    '0.0')
set_param(sys,'Stop time',     '999999')
set_param(sys,'Min step size', '0.0001')
set_param(sys,'Max step size', '10')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars',   '')


%     Subsystem  'Button 1'.

new_system([sys,'/','Button 1'])
set_param([sys,'/','Button 1'],'Location',[514,124,650,277])
set_param([sys,'/','Button 1'],...
		'Mask Display','Parameter\nEstimation',...
		'Mask Dialogue','eval(''parmest'')')


%     Finished composite block 'Button 1'.

set_param([sys,'/','Button 1'],...
		'hide name',0,...
		'position',[45,25,160,95])


%     Subsystem  'Button 2'.

new_system([sys,'/','Button 2'])
set_param([sys,'/','Button 2'],'Location',[-10,380,117,533])
set_param([sys,'/','Button 2'],...
		'Mask Display','F-14 Flight\nControl',...
		'Mask Dialogue','eval(''f14dat; f14'')')


%     Finished composite block 'Button 2'.

set_param([sys,'/','Button 2'],...
		'hide name',0,...
		'position',[180,25,295,95])


%     Subsystem  'Button 4'.

new_system([sys,'/','Button 4'])
set_param([sys,'/','Button 4'],'Location',[-10,380,117,533])
set_param([sys,'/','Button 4'],...
		'Mask Display','Population\nVariation',...
		'Mask Dialogue','eval(''initial_pop=30;pops'')')


%     Finished composite block 'Button 4'.

set_param([sys,'/','Button 4'],...
		'hide name',0,...
		'position',[45,115,160,185])


%     Subsystem  'Button 5'.

new_system([sys,'/','Button 5'])
set_param([sys,'/','Button 5'],'Location',[-10,380,117,533])
set_param([sys,'/','Button 5'],...
		'Mask Display','Van der Pol\nEquations',...
		'Mask Dialogue','eval(''vdp'')')


%     Finished composite block 'Button 5'.

set_param([sys,'/','Button 5'],...
		'hide name',0,...
		'position',[315,115,430,185])


%     Subsystem  'Button 6'.

new_system([sys,'/','Button 6'])
set_param([sys,'/','Button 6'],'Location',[-10,380,117,533])
set_param([sys,'/','Button 6'],...
		'Mask Display','Step Size',...
		'Mask Dialogue','eval(''steps'')')


%     Finished composite block 'Button 6'.

set_param([sys,'/','Button 6'],...
		'hide name',0,...
		'position',[45,205,160,275])


%     Subsystem  'Button 3'.

new_system([sys,'/','Button 3'])
set_param([sys,'/','Button 3'],'Location',[-10,380,117,533])
set_param([sys,'/','Button 3'],...
		'Mask Display','Multi-Variate\nLines',...
		'Mask Dialogue','eval(''multi;'');')


%     Finished composite block 'Button 3'.

set_param([sys,'/','Button 3'],...
		'hide name',0,...
		'position',[315,25,430,95])


%     Subsystem  'Button 9'.

new_system([sys,'/','Button 9'])
set_param([sys,'/','Button 9'],'Location',[-10,380,117,533])
set_param([sys,'/','Button 9'],...
		'Mask Display','House\nThermostat',...
		'Mask Dialogue','eval(''thermdat; thermo'')')


%     Finished composite block 'Button 9'.

set_param([sys,'/','Button 9'],...
		'hide name',0,...
		'position',[180,115,295,185])


%     Subsystem  'Button 7'.

new_system([sys,'/','Button 7'])
set_param([sys,'/','Button 7'],'Location',[-10,380,117,533])
set_param([sys,'/','Button 7'],...
		'Mask Display','Sums & Products',...
		'Mask Dialogue','eval(''sumprod'')')


%     Finished composite block 'Button 7'.

set_param([sys,'/','Button 7'],...
		'hide name',0,...
		'position',[180,205,295,275])


%     Subsystem  'Library'.

new_system([sys,'/','Library'])
set_param([sys,'/','Library'],'Location',[41,141,398,423])


%     Subsystem  'Library/Button 1'.

new_system([sys,'/','Library/Button 1'])
set_param([sys,'/','Library/Button 1'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Button 1'],...
		'Mask Display','Sources',...
		'Mask Dialogue','eval(''sources'')')


%     Finished composite block 'Library/Button 1'.

set_param([sys,'/','Library/Button 1'],...
		'hide name',0,...
		'position',[35,30,100,80])


%     Subsystem  'Library/Button 2'.

new_system([sys,'/','Library/Button 2'])
set_param([sys,'/','Library/Button 2'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Button 2'],...
		'Mask Display','Sinks',...
		'Mask Dialogue','eval(''sinks'')')


%     Finished composite block 'Library/Button 2'.

set_param([sys,'/','Library/Button 2'],...
		'hide name',0,...
		'position',[140,30,203,79])


%     Subsystem  'Library/Button 3'.

new_system([sys,'/','Library/Button 3'])
set_param([sys,'/','Library/Button 3'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Button 3'],...
		'Mask Display','Linear\nBlocks',...
		'Mask Dialogue','eval(''linear'')')


%     Finished composite block 'Library/Button 3'.

set_param([sys,'/','Library/Button 3'],...
		'hide name',0,...
		'position',[240,30,304,80])


%     Subsystem  'Library/Button 6'.

new_system([sys,'/','Library/Button 6'])
set_param([sys,'/','Library/Button 6'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Button 6'],...
		'Mask Display','Ports',...
		'Mask Dialogue','eval(''portdemo'')')


%     Finished composite block 'Library/Button 6'.

set_param([sys,'/','Library/Button 6'],...
		'hide name',0,...
		'position',[240,155,302,207])


%     Subsystem  'Library/Button 5'.

new_system([sys,'/','Library/Button 5'])
set_param([sys,'/','Library/Button 5'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Button 5'],...
		'Mask Display','Discrete\nBlocks',...
		'Mask Dialogue','eval(''discrete'')')


%     Finished composite block 'Library/Button 5'.

set_param([sys,'/','Library/Button 5'],...
		'hide name',0,...
		'position',[140,155,203,208])


%     Subsystem  'Library/Button 4'.

new_system([sys,'/','Library/Button 4'])
set_param([sys,'/','Library/Button 4'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Button 4'],...
		'Mask Display','Nonlinear\nBlocks',...
		'Mask Dialogue','eval(''nonlin'')')


%     Finished composite block 'Library/Button 4'.

set_param([sys,'/','Library/Button 4'],...
		'hide name',0,...
		'position',[35,155,101,208])

add_block('built-in/Note',[sys,'/',['Library/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']])
set_param([sys,'/',['Library/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']],...
		'position',[170,225,175,230])


%     Subsystem  'Library/Special'.

new_system([sys,'/','Library/Special'])
set_param([sys,'/','Library/Special'],'Location',[291,337,740,678])

add_block('built-in/Note',[sys,'/','Library/Special/Double click on any of these blocks to see the demo of your choice'])
set_param([sys,'/','Library/Special/Double click on any of these blocks to see the demo of your choice'],...
		'position',[205,285,210,290])


%     Subsystem  'Library/Special/Button 3'.

new_system([sys,'/','Library/Special/Button 3'])
set_param([sys,'/','Library/Special/Button 3'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Special/Button 3'],...
		'Mask Display','Time Delay\nBlocks',...
		'Mask Dialogue','eval(''tdeldemo'')')


%     Finished composite block 'Library/Special/Button 3'.

set_param([sys,'/','Library/Special/Button 3'],...
		'hide name',0,...
		'position',[285,20,400,90])


%     Subsystem  'Library/Special/Button 6'.

new_system([sys,'/','Library/Special/Button 6'])
set_param([sys,'/','Library/Special/Button 6'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Special/Button 6'],...
		'Mask Display','XY Graph\nBlock',...
		'Mask Dialogue','eval(''lorenzs'')')


%     Finished composite block 'Library/Special/Button 6'.

set_param([sys,'/','Library/Special/Button 6'],...
		'hide name',0,...
		'position',[150,200,265,270])


%     Subsystem  'Library/Special/Button 5'.

new_system([sys,'/','Library/Special/Button 5'])
set_param([sys,'/','Library/Special/Button 5'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Special/Button 5'],...
		'Mask Display','Auto-Scale\nGraph Block',...
		'Mask Dialogue','eval(''lorenz2'')')


%     Finished composite block 'Library/Special/Button 5'.

set_param([sys,'/','Library/Special/Button 5'],...
		'hide name',0,...
		'position',[285,200,400,270])


%     Subsystem  'Library/Special/Button 2'.

new_system([sys,'/','Library/Special/Button 2'])
set_param([sys,'/','Library/Special/Button 2'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Special/Button 2'],...
		'Mask Display','Memory\nBlock',...
		'Mask Dialogue','eval(''memdemo'')')


%     Finished composite block 'Library/Special/Button 2'.

set_param([sys,'/','Library/Special/Button 2'],...
		'hide name',0,...
		'position',[150,20,265,90])


%     Subsystem  'Library/Special/Button 9'.

new_system([sys,'/','Library/Special/Button 9'])
set_param([sys,'/','Library/Special/Button 9'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Special/Button 9'],...
		'Mask Display','Zero- and First-\nOrder Hold\nBlocks',...
		'Mask Dialogue','eval(''fohdemo'')')


%     Finished composite block 'Library/Special/Button 9'.

set_param([sys,'/','Library/Special/Button 9'],...
		'hide name',0,...
		'position',[20,20,135,90])


%     Subsystem  'Library/Special/Button 4'.

new_system([sys,'/','Library/Special/Button 4'])
set_param([sys,'/','Library/Special/Button 4'],'Location',[-10,380,117,533])
set_param([sys,'/','Library/Special/Button 4'],...
		'Mask Display','Reset Integrator\nand\nHit Crossing Block',...
		'Mask Dialogue','eval(''bounce'')')


%     Finished composite block 'Library/Special/Button 4'.

set_param([sys,'/','Library/Special/Button 4'],...
		'hide name',0,...
		'position',[150,110,265,180])


%     Subsystem  'Library/Special/Button 1'.

new_system([sys,'/','Library/Special/Button 1'])
set_param([sys,'/','Library/Special/Button 1'],'Location',[514,124,650,277])
set_param([sys,'/','Library/Special/Button 1'],...
		'Mask Display','2-D Lookup Table\nBlock',...
		'Mask Dialogue','eval(''tabdemo'')')


%     Finished composite block 'Library/Special/Button 1'.

set_param([sys,'/','Library/Special/Button 1'],...
		'hide name',0,...
		'position',[15,200,130,270])
set_param([sys,'/','Library/Special'],...
		'Mask Display','Special\nBlocks')


%     Finished composite block 'Library/Special'.

set_param([sys,'/','Library/Special'],...
		'hide name',0,...
		'position',[140,91,203,140])
set_param([sys,'/','Library'],...
		'Mask Display','Block Library')


%     Finished composite block 'Library'.

set_param([sys,'/','Library'],...
		'hide name',0,...
		'position',[315,205,430,275])


%     Subsystem  'Library1'.

new_system([sys,'/','Library1'])
set_param([sys,'/','Library1'],'Location',[0,56,357,338])

add_block('built-in/Note',[sys,'/',['Library1/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']])
set_param([sys,'/',['Library1/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']],...
		'position',[175,90,180,95])


%     Subsystem  'Library1/Button 4'.

new_system([sys,'/','Library1/Button 4'])
set_param([sys,'/','Library1/Button 4'],'Location',[-10,380,117,533])
set_param([sys,'/','Library1/Button 4'],...
		'Mask Display','Nonlinear\nBlocks',...
		'Mask Dialogue','eval(''nonlin'')')


%     Finished composite block 'Library1/Button 4'.

set_param([sys,'/','Library1/Button 4'],...
		'hide name',0,...
		'position',[35,155,101,208])


%     Subsystem  'Library1/Button 5'.

new_system([sys,'/','Library1/Button 5'])
set_param([sys,'/','Library1/Button 5'],'Location',[-10,380,117,533])
set_param([sys,'/','Library1/Button 5'],...
		'Mask Display','Discrete\nBlocks',...
		'Mask Dialogue','eval(''discrete'')')


%     Finished composite block 'Library1/Button 5'.

set_param([sys,'/','Library1/Button 5'],...
		'hide name',0,...
		'position',[140,155,203,208])


%     Subsystem  'Library1/Button 6'.

new_system([sys,'/','Library1/Button 6'])
set_param([sys,'/','Library1/Button 6'],'Location',[-10,380,117,533])
set_param([sys,'/','Library1/Button 6'],...
		'Mask Display','Ports',...
		'Mask Dialogue','eval(''portdemo'')')


%     Finished composite block 'Library1/Button 6'.

set_param([sys,'/','Library1/Button 6'],...
		'hide name',0,...
		'position',[240,155,302,207])


%     Subsystem  'Library1/Button 3'.

new_system([sys,'/','Library1/Button 3'])
set_param([sys,'/','Library1/Button 3'],'Location',[-10,380,117,533])
set_param([sys,'/','Library1/Button 3'],...
		'Mask Display','Linear\nBlocks',...
		'Mask Dialogue','eval(''linear'')')


%     Finished composite block 'Library1/Button 3'.

set_param([sys,'/','Library1/Button 3'],...
		'hide name',0,...
		'position',[240,30,304,80])


%     Subsystem  'Library1/Button 2'.

new_system([sys,'/','Library1/Button 2'])
set_param([sys,'/','Library1/Button 2'],'Location',[-10,380,117,533])
set_param([sys,'/','Library1/Button 2'],...
		'Mask Display','Sinks',...
		'Mask Dialogue','eval(''sinks'')')


%     Finished composite block 'Library1/Button 2'.

set_param([sys,'/','Library1/Button 2'],...
		'hide name',0,...
		'position',[140,30,203,79])


%     Subsystem  'Library1/Button 1'.

new_system([sys,'/','Library1/Button 1'])
set_param([sys,'/','Library1/Button 1'],'Location',[-10,380,117,533])
set_param([sys,'/','Library1/Button 1'],...
		'Mask Display','Sources',...
		'Mask Dialogue','eval(''sources'')')


%     Finished composite block 'Library1/Button 1'.

set_param([sys,'/','Library1/Button 1'],...
		'hide name',0,...
		'position',[35,30,100,80])
set_param([sys,'/','Library1'],...
		'Mask Display','Adaptive Control',...
		'Mask Dialogue','eval(''rlsest'')')


%     Finished composite block 'Library1'.

set_param([sys,'/','Library1'],...
		'hide name',0,...
		'position',[45,290,160,360])


%     Subsystem  'Library2'.

new_system([sys,'/','Library2'])
set_param([sys,'/','Library2'],'Location',[0,56,357,338])


%     Subsystem  'Library2/Button 1'.

new_system([sys,'/','Library2/Button 1'])
set_param([sys,'/','Library2/Button 1'],'Location',[-10,380,117,533])
set_param([sys,'/','Library2/Button 1'],...
		'Mask Display','Sources',...
		'Mask Dialogue','eval(''sources'')')


%     Finished composite block 'Library2/Button 1'.

set_param([sys,'/','Library2/Button 1'],...
		'hide name',0,...
		'position',[35,30,100,80])


%     Subsystem  'Library2/Button 2'.

new_system([sys,'/','Library2/Button 2'])
set_param([sys,'/','Library2/Button 2'],'Location',[-10,380,117,533])
set_param([sys,'/','Library2/Button 2'],...
		'Mask Display','Sinks',...
		'Mask Dialogue','eval(''sinks'')')


%     Finished composite block 'Library2/Button 2'.

set_param([sys,'/','Library2/Button 2'],...
		'hide name',0,...
		'position',[140,30,203,79])


%     Subsystem  'Library2/Button 3'.

new_system([sys,'/','Library2/Button 3'])
set_param([sys,'/','Library2/Button 3'],'Location',[-10,380,117,533])
set_param([sys,'/','Library2/Button 3'],...
		'Mask Display','Linear\nBlocks',...
		'Mask Dialogue','eval(''linear'')')


%     Finished composite block 'Library2/Button 3'.

set_param([sys,'/','Library2/Button 3'],...
		'hide name',0,...
		'position',[240,30,304,80])


%     Subsystem  'Library2/Button 6'.

new_system([sys,'/','Library2/Button 6'])
set_param([sys,'/','Library2/Button 6'],'Location',[-10,380,117,533])
set_param([sys,'/','Library2/Button 6'],...
		'Mask Display','Ports',...
		'Mask Dialogue','eval(''portdemo'')')


%     Finished composite block 'Library2/Button 6'.

set_param([sys,'/','Library2/Button 6'],...
		'hide name',0,...
		'position',[240,155,302,207])


%     Subsystem  'Library2/Button 5'.

new_system([sys,'/','Library2/Button 5'])
set_param([sys,'/','Library2/Button 5'],'Location',[-10,380,117,533])
set_param([sys,'/','Library2/Button 5'],...
		'Mask Display','Discrete\nBlocks',...
		'Mask Dialogue','eval(''discrete'')')


%     Finished composite block 'Library2/Button 5'.

set_param([sys,'/','Library2/Button 5'],...
		'hide name',0,...
		'position',[140,155,203,208])


%     Subsystem  'Library2/Button 4'.

new_system([sys,'/','Library2/Button 4'])
set_param([sys,'/','Library2/Button 4'],'Location',[-10,380,117,533])
set_param([sys,'/','Library2/Button 4'],...
		'Mask Display','Nonlinear\nBlocks',...
		'Mask Dialogue','eval(''nonlin'')')


%     Finished composite block 'Library2/Button 4'.

set_param([sys,'/','Library2/Button 4'],...
		'hide name',0,...
		'position',[35,155,101,208])

add_block('built-in/Note',[sys,'/',['Library2/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']])
set_param([sys,'/',['Library2/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']],...
		'position',[175,90,180,95])
set_param([sys,'/','Library2'],...
		'Mask Display','Inverted Pendulum\nwith\nAnimation',...
		'Mask Dialogue','eval(''penddemo'')')


%     Finished composite block 'Library2'.

set_param([sys,'/','Library2'],...
		'hide name',0,...
		'position',[180,290,295,360])


%     Subsystem  'Library3'.

new_system([sys,'/','Library3'])
set_param([sys,'/','Library3'],'Location',[0,56,357,338])

add_block('built-in/Note',[sys,'/',['Library3/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']])
set_param([sys,'/',['Library3/Double click on any of ',13,'these blocks to see the ',13,'demo of your choice']],...
		'position',[175,90,180,95])


%     Subsystem  'Library3/Button 4'.

new_system([sys,'/','Library3/Button 4'])
set_param([sys,'/','Library3/Button 4'],'Location',[-10,380,117,533])
set_param([sys,'/','Library3/Button 4'],...
		'Mask Display','Nonlinear\nBlocks',...
		'Mask Dialogue','eval(''nonlin'')')


%     Finished composite block 'Library3/Button 4'.

set_param([sys,'/','Library3/Button 4'],...
		'hide name',0,...
		'position',[35,155,101,208])


%     Subsystem  'Library3/Button 5'.

new_system([sys,'/','Library3/Button 5'])
set_param([sys,'/','Library3/Button 5'],'Location',[-10,380,117,533])
set_param([sys,'/','Library3/Button 5'],...
		'Mask Display','Discrete\nBlocks',...
		'Mask Dialogue','eval(''discrete'')')


%     Finished composite block 'Library3/Button 5'.

set_param([sys,'/','Library3/Button 5'],...
		'hide name',0,...
		'position',[140,155,203,208])


%     Subsystem  'Library3/Button 6'.

new_system([sys,'/','Library3/Button 6'])
set_param([sys,'/','Library3/Button 6'],'Location',[-10,380,117,533])
set_param([sys,'/','Library3/Button 6'],...
		'Mask Display','Ports',...
		'Mask Dialogue','eval(''portdemo'')')


%     Finished composite block 'Library3/Button 6'.

set_param([sys,'/','Library3/Button 6'],...
		'hide name',0,...
		'position',[240,155,302,207])


%     Subsystem  'Library3/Button 3'.

new_system([sys,'/','Library3/Button 3'])
set_param([sys,'/','Library3/Button 3'],'Location',[-10,380,117,533])
set_param([sys,'/','Library3/Button 3'],...
		'Mask Display','Linear\nBlocks',...
		'Mask Dialogue','eval(''linear'')')


%     Finished composite block 'Library3/Button 3'.

set_param([sys,'/','Library3/Button 3'],...
		'hide name',0,...
		'position',[240,30,304,80])


%     Subsystem  'Library3/Button 2'.

new_system([sys,'/','Library3/Button 2'])
set_param([sys,'/','Library3/Button 2'],'Location',[-10,380,117,533])
set_param([sys,'/','Library3/Button 2'],...
		'Mask Display','Sinks',...
		'Mask Dialogue','eval(''sinks'')')


%     Finished composite block 'Library3/Button 2'.

set_param([sys,'/','Library3/Button 2'],...
		'hide name',0,...
		'position',[140,30,203,79])


%     Subsystem  'Library3/Button 1'.

new_system([sys,'/','Library3/Button 1'])
set_param([sys,'/','Library3/Button 1'],'Location',[-10,380,117,533])
set_param([sys,'/','Library3/Button 1'],...
		'Mask Display','Sources',...
		'Mask Dialogue','eval(''sources'')')


%     Finished composite block 'Library3/Button 1'.

set_param([sys,'/','Library3/Button 1'],...
		'hide name',0,...
		'position',[35,30,100,80])
set_param([sys,'/','Library3'],...
		'Mask Display','Ordinary Differential\nEquation\nS-Functions',...
		'Mask Dialogue','eval(''odedemo'')')


%     Finished composite block 'Library3'.

set_param([sys,'/','Library3'],...
		'hide name',0,...
		'position',[315,290,430,360])

add_block('built-in/Note',[sys,'/','Double click on any of these blocks to see the demo of your choice'])
set_param([sys,'/','Double click on any of these blocks to see the demo of your choice'],...
		'position',[235,370,240,375])

drawnow

% Return any arguments.
if (nargin | nargout)
	% Must use feval here to access system in memory
	if (nargin > 3)
		if (flag == 0)
			eval(['[ret,x0,str,ts,xts]=',sys,'(t,x,u,flag);'])
		else
			eval(['ret =', sys,'(t,x,u,flag);'])
		end
	else
		[ret,x0,str,ts,xts] = feval(sys);
	end
else
	drawnow % Flash up the model and execute load callback
end
