function [ret,x0,str]=musyndm3(t,x,u,flag);
%MUSYNDM3	is the M-file description of the SIMULINK system named MUSYNDM3.
%	The block-diagram can be displayed by typing: MUSYNDM3.
%
%	SYS=MUSYNDM3(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 MUSYNDM3 to return state derivitives, FLAG=2
%	discrete states, FLAG=3 system outputs and FLAG=4 next sample
%	time. For more information and other options see SFUNC.
%
%	Calling MUSYNDM3 with a FLAG of zero:
%	[SIZES]=MUSYNDM3([],[],[],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.
%	For the definition of other parameters in SIZES, see SFUNC.
%	See also, TRIM, LINMOD, LINSIM, EULER, RK23, RK45, ADAMS, GEAR.

%	Copyright (c) 1990-94 by The MathWorks, Inc.

% 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',[68,100,778,510])
     open_system(sys)
end;
set_param(sys,'algorithm',		'Linear')
set_param(sys,'Start time',	'0.0')
set_param(sys,'Stop time',		'99999999')
set_param(sys,'Min step size',	'0.005')
set_param(sys,'Max step size',	'0.05')
set_param(sys,'Relative error','1e-3')
set_param(sys,'Return vars',	'')

add_block('built-in/Demux',[sys,'/','Demux2'])
set_param([sys,'/','Demux2'],...
		'outputs','2',...
		'position',[565,290,605,325])

add_block('built-in/Sum',[sys,'/','Sum4'])
set_param([sys,'/','Sum4'],...
		'orientation',1,...
		'position',[415,255,435,275])

add_block('built-in/Demux',[sys,'/','Demux1'])
set_param([sys,'/','Demux1'],...
		'outputs','2',...
		'position',[455,100,495,135])

add_block('built-in/Sum',[sys,'/','Sum2'])
set_param([sys,'/','Sum2'],...
		'position',[95,95,115,115])

add_block('built-in/Sum',[sys,'/','Sum3'])
set_param([sys,'/','Sum3'],...
		'position',[95,225,115,245])

add_block('built-in/Inport',[sys,'/','Inport2'])
set_param([sys,'/','Inport2'],...
		'position',[35,120,55,140])

add_block('built-in/Inport',[sys,'/','Inport3'])
set_param([sys,'/','Inport3'],...
		'Port','2',...
		'position',[30,195,50,215])

add_block('built-in/Mux',[sys,'/','Mux2'])
set_param([sys,'/','Mux2'],...
		'inputs','2',...
		'position',[345,205,375,240])

add_block('built-in/Outport',[sys,'/','Outport '])
set_param([sys,'/','Outport '],...
		'position',[645,100,665,120])

add_block('built-in/Outport',[sys,'/','Outport1 '])
set_param([sys,'/','Outport1 '],...
		'Port','2',...
		'position',[640,140,660,160])

add_block('built-in/Outport',[sys,'/','Outport1 1'])
set_param([sys,'/','Outport1 1'],...
		'Port','3',...
		'position',[655,250,675,270])

add_block('built-in/Outport',[sys,'/','Outport1 2'])
set_param([sys,'/','Outport1 2'],...
		'Port','4',...
		'position',[655,305,675,325])

add_block('built-in/State-space',[sys,'/','controller'])
set_param([sys,'/','controller'],...
		'A','ak',...
		'B','bk',...
		'C','ck',...
		'D','dk',...
		'Mask Display','H_infinity\nController',...
		'Mask Type','H_infty Controller',...
		'Mask Dialogue','H_infty Controller:|ak:|bk:|ck:|dk:')
set_param([sys,'/','controller'],...
		'Mask Translate','ak=@1;bk=@2;ck=@3;dk=@4;')
set_param([sys,'/','controller'],...
		'Mask Help','. Mask and unmask this block to see how it works.Usinf Mu Analysis and Synthesis Toolbox to design a H_infinity Controller. Change the parameters, see the designed system.')
set_param([sys,'/','controller'],...
		'Mask Entries','ak\/bk\/ck\/dk\/',...
		'position',[260,101,335,139])


%     Subsystem  ['additive',13,'noise 2'].

new_system([sys,'/',['additive',13,'noise 2']])
set_param([sys,'/',['additive',13,'noise 2']],'Location',[0,0,262,236])

add_block('built-in/Outport',[sys,'/',['additive',13,'noise 2/out_1']])
set_param([sys,'/',['additive',13,'noise 2/out_1']],...
		'position',[235,70,255,90])

add_block('built-in/White Noise',[sys,'/',['additive',13,'noise 2/White Noise']])
set_param([sys,'/',['additive',13,'noise 2/White Noise']],...
		'Seed','seed',...
		'position',[55,70,75,90])

add_block('built-in/Discrete Transfer Fcn',[sys,'/',['additive',13,'noise 2/Zero Order Hold']])
set_param([sys,'/',['additive',13,'noise 2/Zero Order Hold']],...
		'Numerator','[sqrt(Cov)]',...
		'Denominator','[sqrt(Ts)]',...
		'Sample time','Ts',...
		'position',[140,61,205,99])
add_line([sys,'/',['additive',13,'noise 2']],[210,80;225,80])
add_line([sys,'/',['additive',13,'noise 2']],[80,80;130,80])
set_param([sys,'/',['additive',13,'noise 2']],...
		'Mask Display','plot(t(:),r2(:))',...
		'Mask Type','Continuous White Noise.')
set_param([sys,'/',['additive',13,'noise 2']],...
		'Mask Dialogue','White noise for continuous (s-domain) systems.\nBand-limited using zero-order-hold.|Noise Variance:|Sample Time:|Seed')
set_param([sys,'/',['additive',13,'noise 2']],...
		'Mask Translate','Cov = @1; Ts = @2; seed = @3; r = rand(1,12)-0.5; r2 = [r(1),r;r,r(12)]; t =[1:13;1:13];')
set_param([sys,'/',['additive',13,'noise 2']],...
		'Mask Help','Implemented using white noise into Zero Order Hold block. For faster simulation set sample time to highest value possible but in accordance with the fastest dynamics of system.')
set_param([sys,'/',['additive',13,'noise 2']],...
		'Mask Entries','0.001\/0.1\/123441\/')


%     Finished composite block ['additive',13,'noise 2'].

set_param([sys,'/',['additive',13,'noise 2']],...
		'position',[245,242,285,268])

add_block('built-in/Mux',[sys,'/','Mux'])
set_param([sys,'/','Mux'],...
		'inputs','2',...
		'position',[150,95,180,130])

add_block('built-in/Mux',[sys,'/','Mux1'])
set_param([sys,'/','Mux1'],...
		'inputs','[2,2]',...
		'position',[460,35,490,70])

add_block('built-in/Signal Generator',[sys,'/','Signal Gen.'])
set_param([sys,'/','Signal Gen.'],...
		'Peak','1.000000',...
		'Peak Range','5.000000',...
		'Freq','1.000000',...
		'Freq Range','5.000000',...
		'Wave','Sqr',...
		'Units','Rads',...
		'position',[25,43,70,77])

add_block('built-in/Sum',[sys,'/','Sum1'])
set_param([sys,'/','Sum1'],...
		'inputs','-+',...
		'position',[215,110,235,130])

add_block('built-in/Signal Generator',[sys,'/','Signal Gen.1'])
set_param([sys,'/','Signal Gen.1'],...
		'Peak','3.000000',...
		'Peak Range','15.000000',...
		'Freq','0.500000',...
		'Freq Range','2.500000',...
		'Wave','Sqr',...
		'Units','Rads',...
		'position',[15,243,60,277])


%     Subsystem  ['additive',13,'noise 1'].

new_system([sys,'/',['additive',13,'noise 1']])
set_param([sys,'/',['additive',13,'noise 1']],'Location',[0,0,262,236])

add_block('built-in/Outport',[sys,'/',['additive',13,'noise 1/out_1']])
set_param([sys,'/',['additive',13,'noise 1/out_1']],...
		'position',[235,70,255,90])

add_block('built-in/White Noise',[sys,'/',['additive',13,'noise 1/White Noise']])
set_param([sys,'/',['additive',13,'noise 1/White Noise']],...
		'Seed','seed',...
		'position',[55,70,75,90])

add_block('built-in/Discrete Transfer Fcn',[sys,'/',['additive',13,'noise 1/Zero Order Hold']])
set_param([sys,'/',['additive',13,'noise 1/Zero Order Hold']],...
		'Numerator','[sqrt(Cov)]',...
		'Denominator','[sqrt(Ts)]',...
		'Sample time','Ts',...
		'position',[140,61,205,99])
add_line([sys,'/',['additive',13,'noise 1']],[210,80;225,80])
add_line([sys,'/',['additive',13,'noise 1']],[80,80;130,80])
set_param([sys,'/',['additive',13,'noise 1']],...
		'Mask Display','plot(t(:),r2(:))',...
		'Mask Type','Continuous White Noise.')
set_param([sys,'/',['additive',13,'noise 1']],...
		'Mask Dialogue','White noise for continuous (s-domain) systems.\nBand-limited using zero-order-hold.|Noise Variance:|Sample Time:|Seed')
set_param([sys,'/',['additive',13,'noise 1']],...
		'Mask Translate','Cov = @1; Ts = @2; seed = @3; r = rand(1,12)-0.5; r2 = [r(1),r;r,r(12)]; t =[1:13;1:13];')
set_param([sys,'/',['additive',13,'noise 1']],...
		'Mask Help','Implemented using white noise into Zero Order Hold block. For faster simulation set sample time to highest value possible but in accordance with the fastest dynamics of system.')
set_param([sys,'/',['additive',13,'noise 1']],...
		'Mask Entries','0.001\/0.1\/79841\/')


%     Finished composite block ['additive',13,'noise 1'].

set_param([sys,'/',['additive',13,'noise 1']],...
		'position',[245,177,285,203])

add_block('built-in/Scope',[sys,'/','Scope'])
set_param([sys,'/','Scope'],...
		'Vgain','4.000000',...
		'Hgain','20.000000',...
		'Vmax','Inf',...
		'Hmax','40.000000',...
		'Window',[593,143,912,348],...
		'position',[600,42,620,68])

add_block('built-in/State-space',[sys,'/','perf. weighting'])
set_param([sys,'/','perf. weighting'],...
		'A','ap',...
		'B','bp',...
		'C','cp',...
		'D','dp',...
		'Mask Display','output\nweighting.',...
		'Mask Type','Performance weighting function')
set_param([sys,'/','perf. weighting'],...
		'Mask Dialogue','Performance weighting function:\n[w1  0]\n[ 0 w2]|numerator of w1:|denominator of w1:|numerator of w2:|denominator of w2:')
set_param([sys,'/','perf. weighting'],...
		'Mask Translate','[ap,bp,cp,dp]=unpck(daug(nd2sys(@1,@2),nd2sys(@3,@4)));',...
		'Mask Help','the weighting function of the plant model.',...
		'Mask Entries','num_o1\/den_o1\/num_o2\/den_o2\/')
set_param([sys,'/','perf. weighting'],...
		'position',[470,291,545,329])


%     Subsystem  ['Plant with',13,'Uncertainty'].

new_system([sys,'/',['Plant with',13,'Uncertainty']])
set_param([sys,'/',['Plant with',13,'Uncertainty']],'Location',[417,193,926,461])

add_block('built-in/Outport',[sys,'/',['Plant with',13,'Uncertainty/out_1']])
set_param([sys,'/',['Plant with',13,'Uncertainty/out_1']],...
		'position',[450,200,470,220])

add_block('built-in/Inport',[sys,'/',['Plant with',13,'Uncertainty/in_1']])
set_param([sys,'/',['Plant with',13,'Uncertainty/in_1']],...
		'position',[25,205,45,225])

add_block('built-in/Product',[sys,'/',['Plant with',13,'Uncertainty/Product']])
set_param([sys,'/',['Plant with',13,'Uncertainty/Product']],...
		'position',[230,125,255,145])

add_block('built-in/Sum',[sys,'/',['Plant with',13,'Uncertainty/Sum']])
set_param([sys,'/',['Plant with',13,'Uncertainty/Sum']],...
		'position',[290,200,310,220])

add_block('built-in/Mux',[sys,'/',['Plant with',13,'Uncertainty/Mux1']])
set_param([sys,'/',['Plant with',13,'Uncertainty/Mux1']],...
		'inputs','2',...
		'position',[160,65,190,100])


%     Subsystem  ['Plant with',13,'Uncertainty/multiplicative',13,'noise 2'].

new_system([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],'Location',[0,0,262,236])

add_block('built-in/Outport',[sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2/out_1']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2/out_1']],...
		'position',[235,70,255,90])

add_block('built-in/White Noise',[sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2/White Noise']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2/White Noise']],...
		'Seed','seed',...
		'position',[55,70,75,90])

add_block('built-in/Discrete Transfer Fcn',[sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2/Zero Order Hold']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2/Zero Order Hold']],...
		'Numerator','[sqrt(Cov)]',...
		'Denominator','[sqrt(Ts)]',...
		'Sample time','Ts',...
		'position',[140,61,205,99])
add_line([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],[210,80;225,80])
add_line([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],[80,80;130,80])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],...
		'Mask Display','plot(t(:),r2(:))',...
		'Mask Type','Continuous White Noise.')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],...
		'Mask Dialogue','White noise for continuous (s-domain) systems.\nBand-limited using zero-order-hold.|Noise Variance:|Sample Time:|Seed')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],...
		'Mask Translate','Cov = @1; Ts = @2; seed = @3; r = rand(1,12)-0.5; r2 = [r(1),r;r,r(12)]; t =[1:13;1:13];')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],...
		'Mask Help','Implemented using white noise into Zero Order Hold block. For faster simulation set sample time to highest value possible but in accordance with the fastest dynamics of system.')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],...
		'Mask Entries','0.02\/0.1\/683421\/')


%     Finished composite block ['Plant with',13,'Uncertainty/multiplicative',13,'noise 2'].

set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 2']],...
		'position',[45,77,85,103])

add_block('built-in/State-space',[sys,'/',['Plant with',13,'Uncertainty/pertu. weighting']])
set_param([sys,'/',['Plant with',13,'Uncertainty/pertu. weighting']],...
		'A','ad',...
		'B','bd',...
		'C','cd',...
		'D','dd',...
		'Mask Display','input\nweighting.',...
		'Mask Type','Performance weighting function:')
set_param([sys,'/',['Plant with',13,'Uncertainty/pertu. weighting']],...
		'Mask Dialogue','Performance weighting function:\n[w1  0]\n[ 0 w2]|numerator of w1:|denominator of w1:|numerator of w2:| denominator of w2:')
set_param([sys,'/',['Plant with',13,'Uncertainty/pertu. weighting']],...
		'Mask Translate','[ad,bd,cd,dd]=unpck(daug(nd2sys(@1,@2),nd2sys(@3,@4)));',...
		'Mask Help','This is the weighting function of the plant model.')
set_param([sys,'/',['Plant with',13,'Uncertainty/pertu. weighting']],...
		'Mask Entries','num_i1\/den_i1\/num_i2\/den_i2\/',...
		'position',[120,121,195,159])


%     Subsystem  ['Plant with',13,'Uncertainty/multiplicative',13,'noise 1'].

new_system([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],'Location',[0,0,262,236])

add_block('built-in/Outport',[sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1/out_1']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1/out_1']],...
		'position',[235,70,255,90])

add_block('built-in/White Noise',[sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1/White Noise']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1/White Noise']],...
		'Seed','seed',...
		'position',[55,70,75,90])

add_block('built-in/Discrete Transfer Fcn',[sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1/Zero Order Hold']])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1/Zero Order Hold']],...
		'Numerator','[sqrt(Cov)]',...
		'Denominator','[sqrt(Ts)]',...
		'Sample time','Ts',...
		'position',[140,61,205,99])
add_line([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],[210,80;225,80])
add_line([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],[80,80;130,80])
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],...
		'Mask Display','plot(t(:),r2(:))',...
		'Mask Type','Continuous White Noise.')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],...
		'Mask Dialogue','White noise for continuous (s-domain) systems.\nBand-limited using zero-order-hold.|Noise Variance:|Sample Time:|Seed')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],...
		'Mask Translate','Cov = @1; Ts = @2; seed = @3; r = rand(1,12)-0.5; r2 = [r(1),r;r,r(12)]; t =[1:13;1:13];')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],...
		'Mask Help','Implemented using white noise into Zero Order Hold block. For faster simulation set sample time to highest value possible but in accordance with the fastest dynamics of system.')
set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],...
		'Mask Entries','0.02\/0.1\/68932234\/')


%     Finished composite block ['Plant with',13,'Uncertainty/multiplicative',13,'noise 1'].

set_param([sys,'/',['Plant with',13,'Uncertainty/multiplicative',13,'noise 1']],...
		'position',[45,17,85,43])

add_block('built-in/State-space',[sys,'/',['Plant with',13,'Uncertainty/plant']])
set_param([sys,'/',['Plant with',13,'Uncertainty/plant']],...
		'A','a',...
		'B','b',...
		'C','c',...
		'D','d',...
		'Mask Display','plant\nmodel',...
		'Mask Type','plant',...
		'Mask Dialogue','state space model:|a: |b: |c: |d:')
set_param([sys,'/',['Plant with',13,'Uncertainty/plant']],...
		'Mask Translate','a=@1; b=@2; c=@3; d=@4;',...
		'Mask Help','system plant',...
		'Mask Entries','a\/b\/c\/d\/',...
		'position',[345,191,420,229])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[50,215;280,215])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[85,215;85,140;110,140])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[425,210;440,210])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[90,90;150,90])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[260,135;275,135;275,205;280,205])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[200,140;220,140])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[195,85;215,85;215,130;220,130])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[315,210;335,210])
add_line([sys,'/',['Plant with',13,'Uncertainty']],[90,30;125,30;125,75;150,75])


%     Finished composite block ['Plant with',13,'Uncertainty'].

set_param([sys,'/',['Plant with',13,'Uncertainty']],...
		'position',[365,94,395,146])


%     Subsystem  ['Double click here',13,'to start loading data',13,'and mu-syn design1'].

new_system([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design1']])
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design1']],'Location',[2,439,106,512])
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design1']],...
		'Mask Display','Re-Load\nData',...
		'Mask Type','')
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design1']],...
		'Mask Dialogue','eval(''if ~exist(''''mu''''),fprintf(''''\nMust be licensed for MuSyn Toolbox\n''''), else, fprintf(''''\nLoading Data\nWarning: New data will overlap the original working space data\n>>\n''''); mudata3; end'')')
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design1']],...
		'Mask Translate','',...
		'Mask Help','')


%     Finished composite block ['Double click here',13,'to start loading data',13,'and mu-syn design1'].

set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design1']],...
		'hide name',0,...
		'position',[15,354,95,397])


%     Subsystem  ['Double click here',13,'to start loading data',13,'and mu-syn design2'].

new_system([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design2']])
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design2']],'Location',[2,439,106,512])
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design2']],...
		'Mask Display','Re-design',...
		'Mask Type','')
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design2']],...
		'Mask Dialogue','eval(''if ~exist(''''mu''''),fprintf(''''\nMust be licensed for RCT Toolbox\n''''), else, fprintf(''''\nCtrl_C to abort MuSyn Calculation\n\n''''); mudes3; end'')')
set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design2']],...
		'Mask Translate','',...
		'Mask Help','')


%     Finished composite block ['Double click here',13,'to start loading data',13,'and mu-syn design2'].

set_param([sys,'/',['Double click here',13,'to start loading data',13,'and mu-syn design2']],...
		'hide name',0,...
		'position',[114,354,186,397])


%     Subsystem  ['Double click here',13,'to show bode plot',13,'of closed-loop3'].

new_system([sys,'/',['Double click here',13,'to show bode plot',13,'of closed-loop3']])
set_param([sys,'/',['Double click here',13,'to show bode plot',13,'of closed-loop3']],'Location',[2,439,106,512])
set_param([sys,'/',['Double click here',13,'to show bode plot',13,'of closed-loop3']],...
		'Mask Display','Closed-Loop\nBode Plot',...
		'Mask Type','')
set_param([sys,'/',['Double click here',13,'to show bode plot',13,'of closed-loop3']],...
		'Mask Dialogue','eval(''if ~exist(''''g1''''),fprintf(''''\nMust Load Data & Design First\n''''),else [x,y,z,w]=unpck(g1); [x,y,w]=bode(x,y,z,w); clg; subplot(211); loglog(w,x(:,1)); subplot(212); semilogx(w,y(:,1)); clear x y z w;  end'')')
set_param([sys,'/',['Double click here',13,'to show bode plot',13,'of closed-loop3']],...
		'Mask Translate','',...
		'Mask Help','')


%     Finished composite block ['Double click here',13,'to show bode plot',13,'of closed-loop3'].

set_param([sys,'/',['Double click here',13,'to show bode plot',13,'of closed-loop3']],...
		'hide name',0,...
		'position',[203,356,284,398])


%     Subsystem  ['Double click here',13,'to show zero-pole',13,'plot of closed-loop4'].

new_system([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of closed-loop4']])
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of closed-loop4']],'Location',[2,439,106,512])
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of closed-loop4']],...
		'Mask Display','Controller\nBode Plot',...
		'Mask Type','')
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of closed-loop4']],...
		'Mask Dialogue','eval(''if ~exist(''''k1''''),fprintf(''''\nMust Load Data & Design First\n''''),else [x,y,z,w]=unpck(k1); [x,y,w]=bode(x,y,z,w); clg; subplot(211); loglog(w,x(:,1)); subplot(212); semilogx(w,y(:,1)); clear x y z w; end'')')
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of closed-loop4']],...
		'Mask Translate','',...
		'Mask Help','')


%     Finished composite block ['Double click here',13,'to show zero-pole',13,'plot of closed-loop4'].

set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of closed-loop4']],...
		'hide name',0,...
		'position',[305,355,381,398])


%     Subsystem  ['Double click here',13,'to show bode plot ',13,'of controller'].

new_system([sys,'/',['Double click here',13,'to show bode plot ',13,'of controller']])
set_param([sys,'/',['Double click here',13,'to show bode plot ',13,'of controller']],'Location',[2,439,106,512])
set_param([sys,'/',['Double click here',13,'to show bode plot ',13,'of controller']],...
		'Mask Display','Closed-Loop\nZero-Pole\nLocation',...
		'Mask Type','')
set_param([sys,'/',['Double click here',13,'to show bode plot ',13,'of controller']],...
		'Mask Dialogue','eval(''if ~exist(''''g1''''), printf(''''Must Load Data & Desgin First''''), else, clg, [x,y,z,w]=unpck(g1); pzmap(x,y,z,w), grid; end'')')
set_param([sys,'/',['Double click here',13,'to show bode plot ',13,'of controller']],...
		'Mask Translate','',...
		'Mask Help','')


%     Finished composite block ['Double click here',13,'to show bode plot ',13,'of controller'].

set_param([sys,'/',['Double click here',13,'to show bode plot ',13,'of controller']],...
		'hide name',0,...
		'position',[404,353,488,397])


%     Subsystem  ['Double click here',13,'to show zero-pole',13,'plot of controller'].

new_system([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of controller']])
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of controller']],'Location',[2,439,106,512])
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of controller']],...
		'Mask Display','Controller\nZero-Pole\nLocation',...
		'Mask Type','')
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of controller']],...
		'Mask Dialogue','eval(''if ~exist(''''k1''''), printf(''''Must Load Data & Desgin First''''), else,clg,plot(1:10), [x,y,z,w]=unpck(k1); clg, pzmap(x,y,z,w), end'')')
set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of controller']],...
		'Mask Translate','',...
		'Mask Help','')


%     Finished composite block ['Double click here',13,'to show zero-pole',13,'plot of controller'].

set_param([sys,'/',['Double click here',13,'to show zero-pole',13,'plot of controller']],...
		'hide name',0,...
		'position',[513,355,597,397])


%     Subsystem  ['About the musyn',13,'demo1'].

new_system([sys,'/',['About the musyn',13,'demo1']])
set_param([sys,'/',['About the musyn',13,'demo1']],'Location',[2,439,106,512])
set_param([sys,'/',['About the musyn',13,'demo1']],...
		'Mask Display','?',...
		'Mask Type','',...
		'Mask Dialogue','eval(''clc; more(23); help mudata3; more off; fprintf(''''\n>>\n''''); '')',...
		'Mask Translate','',...
		'Mask Help','')


%     Finished composite block ['About the musyn',13,'demo1'].

set_param([sys,'/',['About the musyn',13,'demo1']],...
		'hide name',0,...
		'position',[617,353,668,396])
add_line(sys,[610,315;645,315])
add_line(sys,[610,300;625,300;625,260;645,260])
add_line(sys,[550,310;555,310])
add_line(sys,[380,225;420,225;420,245])
add_line(sys,[290,255;320,255;320,230;335,230])
add_line(sys,[425,280;425,310;195,310;195,125;205,125])
add_line(sys,[425,310;460,310])
add_line(sys,[65,260;75,260;75,240;85,240])
add_line(sys,[500,125;540,125;540,150;630,150])
add_line(sys,[340,120;355,120])
add_line(sys,[75,60;80,60;80,100;85,100])
add_line(sys,[120,105;140,105])
add_line(sys,[120,235;130,235;130,120;140,120])
add_line(sys,[55,205;75,205;75,230;85,230])
add_line(sys,[60,130;75,130;75,110;85,110])
add_line(sys,[185,115;205,115])
add_line(sys,[240,120;250,120])
add_line(sys,[400,120;445,120])
add_line(sys,[430,120;430,245])
add_line(sys,[290,190;320,190;320,215;335,215])
add_line(sys,[500,110;635,110])
add_line(sys,[430,120;430,60;450,60])
add_line(sys,[195,115;195,45;450,45])
add_line(sys,[495,55;590,55])
% 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]=',sys,'(t,x,u,flag);'])
		else
			eval(['ret =', sys,'(t,x,u,flag);'])
		end
	else
		[ret,x0,str] = feval(sys);
	end
end
