function [ret,x0,str,ts,xts]=s7_4(t,x,u,flag);
%S7_4	is the M-file description of the SIMULINK system named S7_4.
%	The block-diagram can be displayed by typing: S7_4.
%
%	SYS=S7_4(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 S7_4 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 S7_4 with a FLAG of zero:
%	[SIZES]=S7_4([],[],[],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',[4,42,589,457])
     open_system(sys)
end;
set_param(sys,'algorithm',     'RK-23')
set_param(sys,'Start time',    '0.0')
set_param(sys,'Stop time',     't_d')
set_param(sys,'Min step size', 'Tc/10')
set_param(sys,'Max step size', 'Tc')
set_param(sys,'Relative error','1e-8')
set_param(sys,'Return vars',   '')

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space10'])
set_param([sys,'/','Discrete State-Space10'],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','K_p',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','K_p')
set_param([sys,'/','Discrete State-Space10'],...
		'position',[195,229,225,261])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space3'])
set_param([sys,'/','Discrete State-Space3'],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','K_d',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','K_d')
set_param([sys,'/','Discrete State-Space3'],...
		'position',[195,274,225,306])

add_block('built-in/Sum',[sys,'/','Sum7'])
set_param([sys,'/','Sum7'],...
		'hide name',0,...
		'Font Name','Arial',...
		'inputs','+++',...
		'position',[250,259,270,321])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain11']])
set_param([sys,'/',['Matrix',13,'Gain11']],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','I - S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain11']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).')
set_param([sys,'/',['Matrix',13,'Gain11']],...
		'Mask Entries','eye(2,2)-S\/',...
		'position',[95,265,125,295])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain10']])
set_param([sys,'/',['Matrix',13,'Gain10']],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','I -S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain10']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).')
set_param([sys,'/',['Matrix',13,'Gain10']],...
		'Mask Entries','eye(2,2)-S\/',...
		'position',[95,220,125,250])

add_block('built-in/Sum',[sys,'/','Sum4'])
set_param([sys,'/','Sum4'],...
		'hide name',0,...
		'Font Name','Arial',...
		'inputs','+-',...
		'position',[160,225,175,265])

add_block('built-in/Sum',[sys,'/','Sum6'])
set_param([sys,'/','Sum6'],...
		'hide name',0,...
		'Font Name','Arial',...
		'inputs','+-',...
		'position',[160,270,175,310])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain12']])
set_param([sys,'/',['Matrix',13,'Gain12']],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','I -S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain12']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).')
set_param([sys,'/',['Matrix',13,'Gain12']],...
		'Mask Entries','eye(2,2)-S\/',...
		'position',[95,310,125,340])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space'])
set_param([sys,'/','Discrete State-Space'],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','K_di',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','K_di')
set_param([sys,'/','Discrete State-Space'],...
		'position',[195,114,225,146])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space6'])
set_param([sys,'/','Discrete State-Space6'],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','K_pi',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','K_pi')
set_param([sys,'/','Discrete State-Space6'],...
		'position',[195,159,225,191])

add_block('built-in/Sum',[sys,'/','Sum3'])
set_param([sys,'/','Sum3'],...
		'hide name',0,...
		'Font Name','Arial',...
		'inputs','-+++',...
		'position',[250,89,270,156])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain4']])
set_param([sys,'/',['Matrix',13,'Gain4']],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','inv(M_d)',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain4']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).')
set_param([sys,'/',['Matrix',13,'Gain4']],...
		'Mask Entries','iM_di\/',...
		'position',[245,24,300,56])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain8']])
set_param([sys,'/',['Matrix',13,'Gain8']],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain8']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','S\/')
set_param([sys,'/',['Matrix',13,'Gain8']],...
		'position',[95,125,125,155])

add_block('built-in/Sum',[sys,'/','Sum2'])
set_param([sys,'/','Sum2'],...
		'hide name',0,...
		'Font Name','Arial',...
		'inputs','-+',...
		'position',[160,110,175,150])

add_block('built-in/Sum',[sys,'/','Sum5'])
set_param([sys,'/','Sum5'],...
		'hide name',0,...
		'Font Name','Arial',...
		'inputs','-+',...
		'position',[160,155,175,195])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain9']])
set_param([sys,'/',['Matrix',13,'Gain9']],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain9']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','S\/')
set_param([sys,'/',['Matrix',13,'Gain9']],...
		'position',[95,170,125,200])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain7']])
set_param([sys,'/',['Matrix',13,'Gain7']],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain7']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','S\/')
set_param([sys,'/',['Matrix',13,'Gain7']],...
		'position',[95,80,125,110])

add_block('built-in/From Workspace',[sys,'/',['From',13,'Workspace2']])
set_param([sys,'/',['From',13,'Workspace2']],...
		'hide name',0,...
		'Font Name','Arial',...
		'matl_expr','[T,ddp_d]',...
		'position',[5,83,55,107])

add_block('built-in/From Workspace',[sys,'/',['From',13,'Workspace']])
set_param([sys,'/',['From',13,'Workspace']],...
		'hide name',0,...
		'Font Name','Arial',...
		'matl_expr','[T,p_d]',...
		'position',[5,173,55,197])

add_block('built-in/From Workspace',[sys,'/',['From',13,'Workspace3']])
set_param([sys,'/',['From',13,'Workspace3']],...
		'hide name',0,...
		'Font Name','Arial',...
		'matl_expr','[T,dp_d]',...
		'position',[5,128,55,152])


%     Subsystem  'Subsystem4'.

new_system([sys,'/','Subsystem4'])
set_param([sys,'/','Subsystem4'],'Location',[355,393414,500,393509])

add_block('built-in/Note',[sys,'/','Subsystem4/start'])
set_param([sys,'/','Subsystem4/start'],...
		'position',[55,45,60,50])
set_param([sys,'/','Subsystem4'],...
		'Mask Display','variables\ninitialization',...
		'Mask Dialogue','eval(''clear all;i7_4;'')')


%     Finished composite block 'Subsystem4'.

set_param([sys,'/','Subsystem4'],...
		'hide name',0,...
		'Font Name','Arial',...
		'Drop Shadow',4,...
		'position',[5,5,100,51])

add_block('built-in/To Workspace',[sys,'/','To Workspace5'])
set_param([sys,'/','To Workspace5'],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'mat-name','f',...
		'buffer','[5001,1,Ts]',...
		'position',[135,5,185,25])

add_block('built-in/To Workspace',[sys,'/','To Workspace4'])
set_param([sys,'/','To Workspace4'],...
		'hide name',0,...
		'Font Name','Arial',...
		'mat-name','time',...
		'buffer','[5001,1,Ts]',...
		'position',[525,5,575,25])

add_block('built-in/Clock',[sys,'/','Clock'])
set_param([sys,'/','Clock'],...
		'hide name',0,...
		'Font Name','Arial',...
		'position',[470,5,490,25])


%     Subsystem  'environment'.

new_system([sys,'/','environment'])
set_param([sys,'/','environment'],'Location',[238,330,572,401])

add_block('built-in/State-Space',[sys,'/','environment/Matrix gain.2'])
set_param([sys,'/','environment/Matrix gain.2'],...
		'hide name',0,...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','tr(Rc)',...
		'Mask Type','Matrix gain',...
		'Mask Dialogue','Matrix Gain.|Gain matrix:')
set_param([sys,'/','environment/Matrix gain.2'],...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','Rc''\/',...
		'position',[240,20,270,50])

add_block('built-in/Outport',[sys,'/','environment/f'])
set_param([sys,'/','environment/f'],...
		'position',[295,25,315,45])

add_block('built-in/State-Space',[sys,'/','environment/Matrix gain.'])
set_param([sys,'/','environment/Matrix gain.'],...
		'hide name',0,...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','K',...
		'Mask Type','Matrix gain',...
		'Mask Dialogue','Matrix Gain.|Gain matrix:')
set_param([sys,'/','environment/Matrix gain.'],...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','K\/',...
		'position',[190,19,215,51])

add_block('built-in/Constant',[sys,'/','environment/xo'])
set_param([sys,'/','environment/xo'],...
		'hide name',0,...
		'Value','p_e',...
		'position',[35,33,60,57])

add_block('built-in/State-Space',[sys,'/','environment/Matrix gain.1'])
set_param([sys,'/','environment/Matrix gain.1'],...
		'hide name',0,...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','Rc',...
		'Mask Type','Matrix gain',...
		'Mask Dialogue','Matrix Gain.|Gain matrix:')
set_param([sys,'/','environment/Matrix gain.1'],...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','Rc\/',...
		'position',[135,20,165,50])

add_block('built-in/Inport',[sys,'/','environment/p'])
set_param([sys,'/','environment/p'],...
		'position',[10,10,30,30])

add_block('built-in/Sum',[sys,'/','environment/Sum1'])
set_param([sys,'/','environment/Sum1'],...
		'hide name',0,...
		'inputs','+-',...
		'position',[95,9,115,56])
add_line([sys,'/','environment'],[65,45;90,45])
add_line([sys,'/','environment'],[120,35;130,35])
add_line([sys,'/','environment'],[170,35;185,35])
add_line([sys,'/','environment'],[220,35;235,35])
add_line([sys,'/','environment'],[275,35;290,35])
add_line([sys,'/','environment'],[35,20;90,20])
set_param([sys,'/','environment'],...
		'Mask Display','K(p-p_e)')


%     Finished composite block 'environment'.

set_param([sys,'/','environment'],...
		'move name',0,...
		'Font Name','Arial',...
		'position',[480,175,535,205])


%     Subsystem  ['operational space',13,'decoupled arm'].

new_system([sys,'/',['operational space',13,'decoupled arm']])
set_param([sys,'/',['operational space',13,'decoupled arm']],'Location',[6,82,601,441])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/f']])
set_param([sys,'/',['operational space',13,'decoupled arm/f']],...
		'position',[5,4,25,26])


%     Subsystem  ['operational space',13,'decoupled arm/sinusoidal',13,' functions'].

new_system([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],'Location',[188,71,574,199])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn4']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn4']],...
		'hide name',0,...
		'Expr','a(2)*sin(u)',...
		'Mask Display','',...
		'position',[210,89,280,111])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn']],...
		'hide name',0,...
		'Expr','a(1)*cos(u)',...
		'Mask Display','',...
		'position',[210,14,280,36])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn1']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn1']],...
		'hide name',0,...
		'Expr','a(2)*cos(u)',...
		'position',[210,39,280,61])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn3']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Fcn3']],...
		'hide name',0,...
		'Expr','a(1)*sin(u)',...
		'Mask Display','',...
		'position',[210,64,280,86])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Mux']],...
		'hide name',0,...
		'position',[305,9,330,116])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/cs']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/cs']],...
		'position',[355,55,375,75])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Sum2']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Sum2']],...
		'hide name',0,...
		'position',[110,80,125,120])

add_block('built-in/Demux',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Demux']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/Demux']],...
		'hide name',0,...
		'outputs','2',...
		'position',[45,82,85,118])

add_block('built-in/Note',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/q1 + q2']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/q1 + q2']],...
		'position',[145,80,150,85])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/q']])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions/q']],...
		'position',[5,90,25,110])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[30,100;40,100])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[90,90;90,25;205,25])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[90,75;205,75])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[285,100;300,100])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[285,75;300,75])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[285,50;300,50])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[130,100;175,100;175,50;205,50])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[175,100;205,100])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[90,110;105,110])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[90,90;105,90])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[335,65;350,65])
add_line([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],[285,25;300,25])
set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],...
		'Mask Display','cs(q)')


%     Finished composite block ['operational space',13,'decoupled arm/sinusoidal',13,' functions'].

set_param([sys,'/',['operational space',13,'decoupled arm/sinusoidal',13,' functions']],...
		'move name',0,...
		'Font Name','Arial',...
		'position',[440,166,475,204])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/dp']])
set_param([sys,'/',['operational space',13,'decoupled arm/dp']],...
		'Port','2',...
		'position',[570,325,590,345])


%     Subsystem  ['operational space',13,'decoupled arm/analytical',13,'Jacobian'].

new_system([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']])
set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']],'Location',[357,269,578,361])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/Mux']],...
		'hide name',0,...
		'inputs','[2,4]',...
		'position',[60,9,85,76])

add_block('built-in/MATLAB Fcn',[sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/MATLAB Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/MATLAB Fcn']],...
		'hide name',0,...
		'MATLAB Fcn','J_adq',...
		'Output Width','2',...
		'Mask Display','J_a(q)dq',...
		'position',[105,27,165,63])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/dx']])
set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/dx']],...
		'position',[195,35,215,55])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/cs']])
set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/cs']],...
		'Port','2',...
		'position',[5,50,25,70])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/dq']])
set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian/dq']],...
		'position',[5,14,25,36])
add_line([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']],[30,25;55,25])
add_line([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']],[90,45;100,45])
add_line([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']],[170,45;190,45])
add_line([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']],[30,60;55,60])
set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']],...
		'Mask Display','J_a(q)')


%     Finished composite block ['operational space',13,'decoupled arm/analytical',13,'Jacobian'].

set_param([sys,'/',['operational space',13,'decoupled arm/analytical',13,'Jacobian']],...
		'move name',0,...
		'position',[500,315,555,355])


%     Subsystem  ['operational space',13,'decoupled arm/nonlinear',13,'compensation'].

new_system([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],'Location',[162,78,548,264])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/y2']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/y2']],...
		'orientation',2,...
		'position',[10,90,30,110])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Discrete State-Space3']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Discrete State-Space3']],...
		'orientation',2,...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','eye(2,2)',...
		'X0','0')
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Discrete State-Space3']],...
		'Sample time','Tc',...
		'Mask Display','Sampler',...
		'position',[250,134,300,166])

add_block('built-in/State-Space',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/friction']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/friction']],...
		'orientation',2,...
		'move name',0,...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','F_v')
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/friction']],...
		'Mask Type','Matrix Gain',...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;')
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/friction']],...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','F_v\/')
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/friction']],...
		'position',[155,134,190,166])


%     Subsystem  ['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity'].

new_system([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],'Location',[72,102,504,215])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/in_1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/in_1']],...
		'orientation',2,...
		'hide name',0,...
		'position',[465,50,485,70])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Mux']],...
		'orientation',2,...
		'hide name',0,...
		'inputs','2',...
		'position',[50,21,80,99])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Fcn1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Fcn1']],...
		'orientation',2,...
		'hide name',0,...
		'Expr','cos(u)',...
		'position',[210,70,250,90])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Sum2']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Sum2']],...
		'orientation',2,...
		'hide name',0,...
		'position',[275,69,290,91])

add_block('built-in/Demux',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Demux']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Demux']],...
		'orientation',2,...
		'hide name',0,...
		'outputs','2',...
		'position',[340,12,380,108])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Gain']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Gain']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','g*pi_m(3)',...
		'Mask Display','k_2',...
		'position',[160,63,185,97])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Fcn2']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Fcn2']],...
		'orientation',2,...
		'hide name',0,...
		'Expr','cos(u)',...
		'position',[210,25,250,45])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Gain1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Gain1']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','g*pi_m(1)',...
		'Mask Display','k_1',...
		'position',[160,18,185,52])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Sum5']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/Sum5']],...
		'orientation',2,...
		'hide name',0,...
		'position',[105,29,120,51])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/out_1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity/out_1']],...
		'orientation',2,...
		'hide name',0,...
		'position',[5,50,25,70])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[460,60;385,60])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[335,85;295,85])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[270,80;255,80])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[205,80;190,80])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[205,35;190,35])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[335,35;255,35])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[315,35;315,75;295,75])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[155,35;125,35])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[100,40;85,40])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[155,80;85,80])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[155,80;150,80;150,45;125,45])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],[45,60;30,60])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],...
		'Mask Display','g(q)')


%     Finished composite block ['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity'].

set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/gravity']],...
		'orientation',2,...
		'move name',0,...
		'position',[155,23,190,57])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Sum4']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Sum4']],...
		'orientation',2,...
		'hide name',0,...
		'inputs','+++',...
		'position',[60,77,80,123])


%     Subsystem  ['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal'].

new_system([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],'Location',[13,268,538,438])

add_block('built-in/Demux',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Demux2']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Demux2']],...
		'orientation',2,...
		'hide name',0,...
		'outputs','2',...
		'position',[380,79,420,141])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product4']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product4']],...
		'orientation',2,...
		'hide name',0,...
		'position',[285,110,320,130])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/out_1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/out_1']],...
		'orientation',2,...
		'hide name',0,...
		'position',[5,105,25,125])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Gain2']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Gain2']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','-1',...
		'position',[150,28,175,52])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Gain1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Gain1']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','2',...
		'position',[150,88,175,112])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product6']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product6']],...
		'orientation',2,...
		'hide name',0,...
		'position',[195,30,230,50])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/prdiuct 1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/prdiuct 1']],...
		'orientation',2,...
		'hide name',0,...
		'move name',0,...
		'position',[285,25,320,45])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product5']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product5']],...
		'orientation',2,...
		'hide name',0,...
		'position',[195,135,230,155])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product7']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Product7']],...
		'orientation',2,...
		'hide name',0,...
		'position',[195,90,230,110])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Sum']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Sum']],...
		'orientation',2,...
		'hide name',0,...
		'position',[105,95,125,115])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Mux']],...
		'orientation',2,...
		'hide name',0,...
		'inputs','2',...
		'position',[40,97,70,128])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Fcn1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Fcn1']],...
		'orientation',2,...
		'hide name',0,...
		'Expr','sin(u(2))',...
		'position',[410,44,460,66])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Gain']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Gain']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','-a(1)*pi_m(3)',...
		'Mask Display','k_3')
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/Gain']],...
		'position',[370,43,395,67])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/in_1']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/in_1']],...
		'orientation',2,...
		'hide name',0,...
		'position',[495,45,515,65])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/in_2']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal/in_2']],...
		'orientation',2,...
		'hide name',0,...
		'Port','2',...
		'position',[495,100,515,120])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[280,120;270,120;270,140;235,140])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[270,120;270,105;235,105])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[375,95;335,95;325,40])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[335,95;270,95;270,45;235,45])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[270,95;235,95])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[405,55;400,55])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[365,55;355,55;355,30;325,30])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[355,55;355,115;325,115])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[280,35;235,35])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[375,125;325,125])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[190,100;180,100])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[145,100;130,100])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[190,145;150,145;150,110;130,110])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[100,105;75,105])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[35,115;30,115])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[190,40;180,40])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[145,40;95,40;95,120;75,120])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[490,55;465,55])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[490,110;425,110])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],[355,125;355,150;235,150])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],...
		'Mask Display','C(q,dq)dq')


%     Finished composite block ['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal'].

set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Coriolis + centrifugal']],...
		'orientation',2,...
		'move name',0,...
		'position',[135,80,190,115])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/q']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/q']],...
		'orientation',2,...
		'Port','2',...
		'position',[330,30,350,50])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/dq']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/dq']],...
		'orientation',2,...
		'position',[330,140,350,160])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Discrete State-Space2']])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Discrete State-Space2']],...
		'orientation',2,...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','eye(2,2)',...
		'X0','0')
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation/Discrete State-Space2']],...
		'Sample time','Tc',...
		'Mask Display','Sampler',...
		'position',[250,24,300,56])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[245,40;195,40])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[245,150;195,150])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[225,40;225,90;195,90])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[225,150;225,105;195,105])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[150,40;110,40;110,85;85,85])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[55,100;35,100])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[150,150;110,150;110,115;85,115])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[325,40;305,40])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[325,150;305,150])
add_line([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],[130,100;85,100])
set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],...
		'Mask Display','n(q,dq)')


%     Finished composite block ['operational space',13,'decoupled arm/nonlinear',13,'compensation'].

set_param([sys,'/',['operational space',13,'decoupled arm/nonlinear',13,'compensation']],...
		'orientation',2,...
		'move name',0,...
		'position',[330,231,380,269])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/u']])
set_param([sys,'/',['operational space',13,'decoupled arm/u']],...
		'Port','2',...
		'position',[5,138,25,162])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/Sum3']])
set_param([sys,'/',['operational space',13,'decoupled arm/Sum3']],...
		'hide name',0,...
		'inputs','+-',...
		'position',[60,141,80,179])


%     Subsystem  ['operational space',13,'decoupled arm/Jacobian inverse'].

new_system([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],'Location',[189,235,477,321])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/u1']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/u1']],...
		'position',[5,15,25,35])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/cs']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/cs']],...
		'Port','2',...
		'position',[5,50,25,70])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/y']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/y']],...
		'position',[260,35,280,55])

add_block('built-in/MATLAB Fcn',[sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/MATLAB Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/MATLAB Fcn']],...
		'hide name',0,...
		'MATLAB Fcn','invJ_a',...
		'Output Width','2',...
		'Mask Display','inv(J_a(q))',...
		'position',[165,29,235,61])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/Mux']],...
		'hide name',0,...
		'inputs','[2,4]',...
		'position',[115,9,140,76])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/Discrete State-Space4']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/Discrete State-Space4']],...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(4,1)',...
		'D','eye(4,4)',...
		'X0','0',...
		'Sample time','Tc')
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse/Discrete State-Space4']],...
		'Mask Display','Sampler',...
		'position',[45,45,95,75])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],[240,45;255,45])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],[145,45;160,45])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],[30,25;110,25])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],[100,60;110,60])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],[30,60;40,60])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],...
		'Mask Display','inv(J_a(q))')


%     Finished composite block ['operational space',13,'decoupled arm/Jacobian inverse'].

set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian inverse']],...
		'move name',0,...
		'position',[105,150,160,185])


%     Subsystem  ['operational space',13,'decoupled arm/inertia'].

new_system([sys,'/',['operational space',13,'decoupled arm/inertia']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia']],'Location',[247,236,577,328])

add_block('built-in/MATLAB Fcn',[sys,'/',['operational space',13,'decoupled arm/inertia/invB',13,'']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/invB',13,'']],...
		'hide name',0,...
		'MATLAB Fcn','iner(u(3))*u(1:2)',...
		'Output Width','2',...
		'Mask Display','B(q)',...
		'position',[230,30,280,60])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/inertia/Discrete State-Space3']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/Discrete State-Space3']],...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','eye(2,2)',...
		'X0','0',...
		'Sample time','Tc')
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/Discrete State-Space3']],...
		'Mask Display','Sampler',...
		'position',[45,10,95,40])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/inertia/Discrete State-Space2']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/Discrete State-Space2']],...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','eye(2,2)',...
		'X0','0',...
		'Sample time','Tc')
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/Discrete State-Space2']],...
		'Mask Display','Sampler',...
		'position',[45,50,95,80])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/inertia/y1']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/y1']],...
		'position',[305,35,325,55])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/inertia/Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/Fcn']],...
		'hide name',0,...
		'Expr','cos(u(2))',...
		'position',[115,54,165,76])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/inertia/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/Mux']],...
		'hide name',0,...
		'inputs','[2,1]',...
		'position',[185,7,210,83])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/inertia/q']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/q']],...
		'Port','2',...
		'position',[5,55,25,75])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/inertia/y']])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia/y']],...
		'position',[5,15,25,35])
add_line([sys,'/',['operational space',13,'decoupled arm/inertia']],[170,65;180,65])
add_line([sys,'/',['operational space',13,'decoupled arm/inertia']],[285,45;300,45])
add_line([sys,'/',['operational space',13,'decoupled arm/inertia']],[215,45;225,45])
add_line([sys,'/',['operational space',13,'decoupled arm/inertia']],[30,65;40,65])
add_line([sys,'/',['operational space',13,'decoupled arm/inertia']],[100,65;110,65])
add_line([sys,'/',['operational space',13,'decoupled arm/inertia']],[30,25;40,25])
add_line([sys,'/',['operational space',13,'decoupled arm/inertia']],[100,25;180,25])
set_param([sys,'/',['operational space',13,'decoupled arm/inertia']],...
		'Mask Display','B(q)y')


%     Finished composite block ['operational space',13,'decoupled arm/inertia'].

set_param([sys,'/',['operational space',13,'decoupled arm/inertia']],...
		'move name',0,...
		'position',[180,162,230,193])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/Sum2']])
set_param([sys,'/',['operational space',13,'decoupled arm/Sum2']],...
		'hide name',0,...
		'inputs','-+++',...
		'position',[265,143,285,202])


%     Subsystem  ['operational space',13,'decoupled arm/arm'].

new_system([sys,'/',['operational space',13,'decoupled arm/arm']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm']],'Location',[136,177,525,434])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/arm/tau']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/tau']],...
		'position',[10,140,30,160])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/arm/Sum']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Sum']],...
		'hide name',0,...
		'inputs','--+-',...
		'position',[85,109,105,176])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/arm/dq']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/dq']],...
		'position',[355,105,375,125])


%     Subsystem  ['operational space',13,'decoupled arm/arm/resolved acc'].

new_system([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],'Location',[120,197,432,294])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/Fcn']],...
		'hide name',0,...
		'Expr','cos(u(2))',...
		'position',[65,59,120,81])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/Mux']],...
		'hide name',0,...
		'inputs','[2,1]',...
		'position',[155,12,180,88])

add_block('built-in/MATLAB Fcn',[sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/invB',13,'']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/invB',13,'']],...
		'hide name',0,...
		'MATLAB Fcn','inv(iner_l(u(3)))*u(1:2)',...
		'Output Width','2',...
		'Mask Display','inv(B(q))',...
		'position',[200,38,255,62])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/ddq']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/ddq']],...
		'position',[275,40,295,60])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/q']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/q']],...
		'Port','2',...
		'position',[25,60,45,80])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/tau - tau''']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc/tau - tau''']],...
		'position',[25,20,45,40])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],[185,50;195,50])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],[50,30;150,30])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],[260,50;270,50])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],[50,70;60,70])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],[125,70;150,70])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],...
		'Mask Display','inv(B(q))')


%     Finished composite block ['operational space',13,'decoupled arm/arm/resolved acc'].

set_param([sys,'/',['operational space',13,'decoupled arm/arm/resolved acc']],...
		'move name',0,...
		'position',[130,135,185,175])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/arm/q',13,'']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/q',13,'']],...
		'Port','2',...
		'position',[355,145,375,165])

add_block('built-in/Integrator',[sys,'/',['operational space',13,'decoupled arm/arm/Integrator1']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Integrator1']],...
		'hide name',0,...
		'Initial','q_0',...
		'position',[265,140,290,170])

add_block('built-in/Integrator',[sys,'/',['operational space',13,'decoupled arm/arm/Integrator']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Integrator']],...
		'hide name',0,...
		'Initial','[0 0]',...
		'position',[205,140,230,170])

add_block('built-in/State-Space',[sys,'/',['operational space',13,'decoupled arm/arm/friction']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/friction']],...
		'orientation',2,...
		'move name',0,...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','F_v',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['operational space',13,'decoupled arm/arm/friction']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;')
set_param([sys,'/',['operational space',13,'decoupled arm/arm/friction']],...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','F_v\/',...
		'position',[140,79,175,111])


%     Subsystem  ['operational space',13,'decoupled arm/arm/gravity'].

new_system([sys,'/',['operational space',13,'decoupled arm/arm/gravity']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],'Location',[45,250,482,363])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/g']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/g']],...
		'orientation',2,...
		'position',[5,50,25,70])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Sum5']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Sum5']],...
		'orientation',2,...
		'hide name',0,...
		'position',[105,29,120,51])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Gain1']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Gain1']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','g*pi_l(1)',...
		'Mask Display','k_1',...
		'position',[160,18,185,52])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Fcn2']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Fcn2']],...
		'orientation',2,...
		'hide name',0,...
		'Expr','cos(u)',...
		'position',[210,25,250,45])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Gain']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Gain']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','g*pi_l(3)',...
		'Mask Display','k_2',...
		'position',[160,63,185,97])

add_block('built-in/Demux',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Demux']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Demux']],...
		'orientation',2,...
		'hide name',0,...
		'outputs','2',...
		'position',[340,12,380,108])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Sum2']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Sum2']],...
		'orientation',2,...
		'hide name',0,...
		'position',[270,70,290,90])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Fcn1']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Fcn1']],...
		'orientation',2,...
		'hide name',0,...
		'Expr','cos(u)',...
		'position',[210,70,250,90])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/Mux']],...
		'orientation',2,...
		'hide name',0,...
		'inputs','2',...
		'position',[50,21,80,99])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/arm/gravity/q']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity/q']],...
		'orientation',2,...
		'position',[415,50,435,70])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[45,60;30,60])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[155,80;85,80])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[155,80;150,80;150,45;125,45])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[100,40;85,40])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[155,35;125,35])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[335,35;255,35])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[315,35;315,75;295,75])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[205,35;190,35])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[205,80;190,80])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[265,80;255,80])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[335,85;295,85])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],[410,60;385,60])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],...
		'Mask Display','g(q)')


%     Finished composite block ['operational space',13,'decoupled arm/arm/gravity'].

set_param([sys,'/',['operational space',13,'decoupled arm/arm/gravity']],...
		'orientation',2,...
		'move name',0,...
		'position',[140,218,175,252])


%     Subsystem  ['operational space',13,'decoupled arm/arm/Coriolis + centrifugal'].

new_system([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],'Location',[36,268,587,438])

add_block('built-in/Demux',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Demux2']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Demux2']],...
		'orientation',2,...
		'hide name',0,...
		'outputs','2',...
		'position',[440,74,480,136])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product4']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product4']],...
		'orientation',2,...
		'hide name',0,...
		'position',[285,105,320,125])

add_block('built-in/Fcn',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Fcn1']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Fcn1']],...
		'orientation',2,...
		'hide name',0,...
		'Expr','sin(u(2))',...
		'position',[430,39,480,61])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Gain']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Gain']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','-a(1)*pi_l(3)',...
		'Mask Display','k_3',...
		'position',[380,38,405,62])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Cdq']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Cdq']],...
		'orientation',2,...
		'position',[5,100,25,120])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Gain2']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Gain2']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','-1',...
		'position',[150,23,175,47])

add_block('built-in/Gain',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Gain1']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Gain1']],...
		'orientation',2,...
		'hide name',0,...
		'Gain','2',...
		'position',[150,83,175,107])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product6']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product6']],...
		'orientation',2,...
		'hide name',0,...
		'position',[195,25,230,45])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/prdiuct 1']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/prdiuct 1']],...
		'orientation',2,...
		'hide name',0,...
		'move name',0,...
		'position',[285,20,320,40])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product5']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product5']],...
		'orientation',2,...
		'hide name',0,...
		'position',[195,130,230,150])

add_block('built-in/Product',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product7']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Product7']],...
		'orientation',2,...
		'hide name',0,...
		'position',[195,85,230,105])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Sum']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Sum']],...
		'orientation',2,...
		'hide name',0,...
		'position',[105,90,125,110])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/Mux']],...
		'orientation',2,...
		'hide name',0,...
		'inputs','2',...
		'position',[40,92,70,123])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/q']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/q']],...
		'orientation',2,...
		'position',[525,40,545,60])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/dq']])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal/dq']],...
		'orientation',2,...
		'Port','2',...
		'position',[525,95,545,115])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[280,115;270,115;270,135;235,135])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[270,115;270,100;235,100])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[435,90;335,90;325,35])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[335,90;270,90;270,40;235,40])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[270,90;235,90])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[520,50;485,50])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[425,50;410,50])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[375,50;355,50;355,25;325,25])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[355,50;355,110;325,110])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[280,30;235,30])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[435,120;325,120])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[355,120;355,145;235,145])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[190,95;180,95])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[145,95;130,95])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[190,140;150,140;150,105;130,105])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[100,100;75,100])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[35,110;30,110])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[190,35;180,35])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[145,35;95,35;95,115;75,115])
add_line([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],[520,105;485,105])
set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],...
		'Mask Display','C(q,dq)dq')


%     Finished composite block ['operational space',13,'decoupled arm/arm/Coriolis + centrifugal'].

set_param([sys,'/',['operational space',13,'decoupled arm/arm/Coriolis + centrifugal']],...
		'orientation',2,...
		'move name',0,...
		'position',[130,20,185,55])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[295,155;310,155;310,200;115,200;125,165])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[310,155;350,155])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[235,155;243,155;243,95;180,95])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[243,95;243,45;190,45])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[243,115;350,115])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[135,235;65,235;65,165;80,165])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[135,95;65,95;65,120;80,120])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[310,200;310,235;180,235])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[110,145;125,145])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[235,155;260,155])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[190,155;200,155])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[35,150;80,150])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[310,155;310,30;190,30])
add_line([sys,'/',['operational space',13,'decoupled arm/arm']],[125,40;50,40;50,135;80,135])
set_param([sys,'/',['operational space',13,'decoupled arm/arm']],...
		'Mask Display','inv(B(q))(tau-tau'')')


%     Finished composite block ['operational space',13,'decoupled arm/arm'].

set_param([sys,'/',['operational space',13,'decoupled arm/arm']],...
		'move name',0,...
		'position',[305,156,400,194])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/p']])
set_param([sys,'/',['operational space',13,'decoupled arm/p']],...
		'position',[570,175,590,195])

add_block('built-in/Note',[sys,'/',['operational space',13,'decoupled arm/q']])
set_param([sys,'/',['operational space',13,'decoupled arm/q']],...
		'position',[405,165,410,171])

add_block('built-in/Note',[sys,'/',['operational space',13,'decoupled arm/dq']])
set_param([sys,'/',['operational space',13,'decoupled arm/dq']],...
		'position',[405,146,410,151])


%     Subsystem  ['operational space',13,'decoupled arm/direct ',13,'kinematics'].

new_system([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],'Location',[257,348,577,414])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/p']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/p']],...
		'position',[285,25,305,45])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Mux']],...
		'hide name',0,...
		'inputs','2',...
		'position',[230,18,260,47])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Sum']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Sum']],...
		'hide name',0,...
		'inputs','+',...
		'position',[175,14,195,36])

add_block('built-in/Note',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/x']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/x']],...
		'position',[210,5,215,10])

add_block('built-in/Note',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/y']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/y']],...
		'position',[210,20,215,25])

add_block('built-in/Demux',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Demux']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Demux']],...
		'hide name',0,...
		'outputs','[2,2]',...
		'position',[60,16,110,49])

add_block('built-in/Sum',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Sum1']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/Sum1']],...
		'hide name',0,...
		'inputs','+',...
		'position',[135,29,155,51])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/cs']])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics/cs']],...
		'position',[15,25,35,45])
add_line([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],[160,40;225,40])
add_line([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],[200,25;225,25])
add_line([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],[115,40;130,40])
add_line([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],[115,25;170,25])
add_line([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],[40,35;55,35])
add_line([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],[265,35;280,35])
set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],...
		'Mask Display','k(q)')


%     Finished composite block ['operational space',13,'decoupled arm/direct ',13,'kinematics'].

set_param([sys,'/',['operational space',13,'decoupled arm/direct ',13,'kinematics']],...
		'move name',0,...
		'Font Name','Arial',...
		'position',[515,167,550,203])


%     Subsystem  ['operational space',13,'decoupled arm/contact force'].

new_system([sys,'/',['operational space',13,'decoupled arm/contact force']])
set_param([sys,'/',['operational space',13,'decoupled arm/contact force']],'Location',[255,285,473,367])

add_block('built-in/MATLAB Fcn',[sys,'/',['operational space',13,'decoupled arm/contact force/MATLAB Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/contact force/MATLAB Fcn']],...
		'hide name',0,...
		'MATLAB Fcn','trJ_a',...
		'Output Width','2',...
		'Mask Display','J''_a(q)f',...
		'position',[110,24,165,56])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/contact force/tau_f']])
set_param([sys,'/',['operational space',13,'decoupled arm/contact force/tau_f']],...
		'position',[190,30,210,50])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/contact force/f']])
set_param([sys,'/',['operational space',13,'decoupled arm/contact force/f']],...
		'position',[5,10,25,30])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/contact force/cs']])
set_param([sys,'/',['operational space',13,'decoupled arm/contact force/cs']],...
		'Port','2',...
		'position',[5,45,25,65])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/contact force/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/contact force/Mux']],...
		'hide name',0,...
		'inputs','[2,4]',...
		'position',[55,4,80,71])
add_line([sys,'/',['operational space',13,'decoupled arm/contact force']],[30,20;50,20])
add_line([sys,'/',['operational space',13,'decoupled arm/contact force']],[30,55;50,55])
add_line([sys,'/',['operational space',13,'decoupled arm/contact force']],[85,40;105,40])
add_line([sys,'/',['operational space',13,'decoupled arm/contact force']],[170,40;185,40])
set_param([sys,'/',['operational space',13,'decoupled arm/contact force']],...
		'Mask Display','tr(J_a(q))f')


%     Finished composite block ['operational space',13,'decoupled arm/contact force'].

set_param([sys,'/',['operational space',13,'decoupled arm/contact force']],...
		'orientation',2,...
		'move name',0,...
		'position',[330,95,385,135])


%     Subsystem  ['operational space',13,'decoupled arm/Jacobian transpose'].

new_system([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],'Location',[182,224,467,315])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Discrete State-Space5']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Discrete State-Space5']],...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(4,1)',...
		'D','eye(4,4)',...
		'X0','0',...
		'Sample time','Tc')
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Discrete State-Space5']],...
		'Mask Display','Sampler',...
		'position',[50,40,100,70])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Discrete State-Space4']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Discrete State-Space4']],...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','eye(2,2)',...
		'X0','0',...
		'Sample time','Tc')
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Discrete State-Space4']],...
		'Mask Display','Sampler',...
		'position',[50,5,100,35])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/Mux']],...
		'hide name',0,...
		'inputs','[2,4]',...
		'position',[120,4,145,71])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/tau_f']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/tau_f']],...
		'position',[255,30,275,50])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/cs']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/cs']],...
		'Port','2',...
		'position',[5,45,25,65])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/f']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/f']],...
		'position',[5,10,25,30])

add_block('built-in/MATLAB Fcn',[sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/MATLAB Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose/MATLAB Fcn']],...
		'hide name',0,...
		'MATLAB Fcn','trJ_a',...
		'Output Width','2',...
		'Mask Display','J''_a(q)f',...
		'position',[175,24,230,56])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],[235,40;250,40])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],[150,40;170,40])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],[30,20;45,20])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],[105,20;115,20])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],[30,55;45,55])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],[105,55;115,55])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],...
		'Mask Display','tr(J_a(q))')


%     Finished composite block ['operational space',13,'decoupled arm/Jacobian transpose'].

set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian transpose']],...
		'orientation',2,...
		'move name',0,...
		'position',[265,35,320,75])


%     Subsystem  ['operational space',13,'decoupled arm/Jacobian derivative'].

new_system([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],'Location',[148,268,450,349])

add_block('built-in/Mux',[sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Mux']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Mux']],...
		'hide name',0,...
		'inputs','[2,4]',...
		'position',[125,4,150,71])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Discrete State-Space3']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Discrete State-Space3']],...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','eye(2,2)',...
		'X0','0',...
		'Sample time','Tc')
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Discrete State-Space3']],...
		'Mask Display','Sampler',...
		'position',[55,5,105,35])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/dq']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/dq']],...
		'position',[10,9,30,31])

add_block('built-in/Inport',[sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/cs']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/cs']],...
		'Port','2',...
		'position',[10,45,30,65])

add_block('built-in/MATLAB Fcn',[sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/MATLAB Fcn']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/MATLAB Fcn']],...
		'hide name',0,...
		'MATLAB Fcn','dJ_a',...
		'Output Width','2',...
		'Mask Display','dJ_a(q,dq)dq',...
		'position',[170,23,250,57])

add_block('built-in/Outport',[sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/dJ']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/dJ']],...
		'position',[275,30,295,50])

add_block('built-in/Discrete State-Space',[sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Discrete State-Space4']])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Discrete State-Space4']],...
		'hide name',0,...
		'A','0',...
		'B','0',...
		'C','zeros(4,1)',...
		'D','eye(4,4)',...
		'X0','0',...
		'Sample time','Tc')
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative/Discrete State-Space4']],...
		'Mask Display','Sampler',...
		'position',[55,40,105,70])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],[110,20;120,20])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],[35,20;50,20])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],[155,40;165,40])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],[255,40;270,40])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],[35,55;50,55])
add_line([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],[110,55;120,55])
set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],...
		'Mask Display','dJ_a(q,dq)')


%     Finished composite block ['operational space',13,'decoupled arm/Jacobian derivative'].

set_param([sys,'/',['operational space',13,'decoupled arm/Jacobian derivative']],...
		'orientation',2,...
		'move name',0,...
		'position',[265,315,325,355])
add_line([sys,'/',['operational space',13,'decoupled arm']],[165,170;175,170])
add_line([sys,'/',['operational space',13,'decoupled arm']],[290,175;300,175])
add_line([sys,'/',['operational space',13,'decoupled arm']],[405,185;435,185])
add_line([sys,'/',['operational space',13,'decoupled arm']],[405,165;425,165;425,240;385,240])
add_line([sys,'/',['operational space',13,'decoupled arm']],[480,185;510,185])
add_line([sys,'/',['operational space',13,'decoupled arm']],[425,240;425,325;330,325])
add_line([sys,'/',['operational space',13,'decoupled arm']],[555,185;565,185])
add_line([sys,'/',['operational space',13,'decoupled arm']],[560,335;565,335])
add_line([sys,'/',['operational space',13,'decoupled arm']],[85,160;100,160])
add_line([sys,'/',['operational space',13,'decoupled arm']],[405,185;415,185;415,280;165,280;175,185])
add_line([sys,'/',['operational space',13,'decoupled arm']],[325,115;250,115;260,150])
add_line([sys,'/',['operational space',13,'decoupled arm']],[480,185;483,185;483,295;90,295;100,175])
add_line([sys,'/',['operational space',13,'decoupled arm']],[30,150;55,150])
add_line([sys,'/',['operational space',13,'decoupled arm']],[260,335;45,335;55,170])
add_line([sys,'/',['operational space',13,'decoupled arm']],[415,260;385,260])
add_line([sys,'/',['operational space',13,'decoupled arm']],[325,250;250,250;260,195])
add_line([sys,'/',['operational space',13,'decoupled arm']],[235,180;260,180])
add_line([sys,'/',['operational space',13,'decoupled arm']],[260,55;240,55;240,165;260,165])
add_line([sys,'/',['operational space',13,'decoupled arm']],[425,325;495,325])
add_line([sys,'/',['operational space',13,'decoupled arm']],[480,185;483,185;483,125;390,125])
add_line([sys,'/',['operational space',13,'decoupled arm']],[483,125;483,65;325,65])
add_line([sys,'/',['operational space',13,'decoupled arm']],[483,295;483,345;330,345])
add_line([sys,'/',['operational space',13,'decoupled arm']],[483,345;495,345])
add_line([sys,'/',['operational space',13,'decoupled arm']],[30,15;420,15;420,45;325,45])
add_line([sys,'/',['operational space',13,'decoupled arm']],[420,45;420,105;390,105])
set_param([sys,'/',['operational space',13,'decoupled arm']],...
		'Mask Display','u = ddp')


%     Finished composite block ['operational space',13,'decoupled arm'].

set_param([sys,'/',['operational space',13,'decoupled arm']],...
		'move name',0,...
		'Font Name','Arial',...
		'position',[395,178,460,222])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain1']])
set_param([sys,'/',['Matrix',13,'Gain1']],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain1']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','S\/')
set_param([sys,'/',['Matrix',13,'Gain1']],...
		'position',[340,65,370,95])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space8'])
set_param([sys,'/','Discrete State-Space8'],...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','Rc''',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','tr(Rc)')
set_param([sys,'/','Discrete State-Space8'],...
		'position',[340,195,370,225])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space9'])
set_param([sys,'/','Discrete State-Space9'],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','Rc',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','Rc')
set_param([sys,'/','Discrete State-Space9'],...
		'position',[495,45,525,75])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space7'])
set_param([sys,'/','Discrete State-Space7'],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','Rc',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','Rc')
set_param([sys,'/','Discrete State-Space7'],...
		'position',[395,65,425,95])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain3']])
set_param([sys,'/',['Matrix',13,'Gain3']],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain3']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','S\/')
set_param([sys,'/',['Matrix',13,'Gain3']],...
		'position',[340,25,370,55])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space13'])
set_param([sys,'/','Discrete State-Space13'],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','Rc',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','Rc')
set_param([sys,'/','Discrete State-Space13'],...
		'position',[395,25,425,55])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain2']])
set_param([sys,'/',['Matrix',13,'Gain2']],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain2']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).',...
		'Mask Entries','S\/')
set_param([sys,'/',['Matrix',13,'Gain2']],...
		'position',[445,45,475,75])

add_block('built-in/Sum',[sys,'/','Sum1'])
set_param([sys,'/','Sum1'],...
		'hide name',0,...
		'Font Name','Arial',...
		'position',[305,190,320,230])


%     Subsystem  'Subsystem8'.

new_system([sys,'/','Subsystem8'])
set_param([sys,'/','Subsystem8'],'Location',[355,393414,500,393509])

add_block('built-in/Note',[sys,'/','Subsystem8/start'])
set_param([sys,'/','Subsystem8/start'],...
		'position',[55,45,60,50])
set_param([sys,'/','Subsystem8'],...
		'Mask Display','plot',...
		'Mask Dialogue','eval(''p7_4;'')')


%     Finished composite block 'Subsystem8'.

set_param([sys,'/','Subsystem8'],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'Drop Shadow',4,...
		'position',[505,375,575,406])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space12'])
set_param([sys,'/','Discrete State-Space12'],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','Rc',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','Rc')
set_param([sys,'/','Discrete State-Space12'],...
		'position',[495,325,525,355])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain14']])
set_param([sys,'/',['Matrix',13,'Gain14']],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','I - S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain14']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).')
set_param([sys,'/',['Matrix',13,'Gain14']],...
		'Mask Entries','eye(2,2)-S\/',...
		'position',[445,325,475,355])

add_block('built-in/Discrete State-Space',[sys,'/','Discrete State-Space11'])
set_param([sys,'/','Discrete State-Space11'],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','0',...
		'B','0',...
		'C','zeros(2,1)',...
		'D','Rc',...
		'X0','0',...
		'Sample time','Tc',...
		'Mask Display','Rc')
set_param([sys,'/','Discrete State-Space11'],...
		'position',[395,345,425,375])

add_block('built-in/State-Space',[sys,'/',['Matrix',13,'Gain13']])
set_param([sys,'/',['Matrix',13,'Gain13']],...
		'orientation',2,...
		'hide name',0,...
		'Font Name','Arial',...
		'A','[]',...
		'B','[]',...
		'C','[]',...
		'D','K',...
		'Mask Display','I - S',...
		'Mask Type','Matrix Gain')
set_param([sys,'/',['Matrix',13,'Gain13']],...
		'Mask Dialogue','Matrix Gain.|Gain matrix:',...
		'Mask Translate','K = @1;',...
		'Mask Help','Multiplies input vector by entered matrix to produce output vector (y=Au).')
set_param([sys,'/',['Matrix',13,'Gain13']],...
		'Mask Entries','eye(2,2)-S\/',...
		'position',[340,345,370,375])

add_block('built-in/To Workspace',[sys,'/','To Workspace6'])
set_param([sys,'/','To Workspace6'],...
		'hide name',0,...
		'Font Name','Arial',...
		'mat-name','e',...
		'buffer','[5001,1,Ts]',...
		'position',[200,375,250,395])

add_block('built-in/Note',[sys,'/','p'])
set_param([sys,'/','p'],...
		'Font Name','Arial',...
		'position',[550,215,555,220])

add_block('built-in/Note',[sys,'/','dp'])
set_param([sys,'/','dp'],...
		'Font Name','Arial',...
		'position',[550,190,555,195])

add_block('built-in/Note',[sys,'/','f'])
set_param([sys,'/','f'],...
		'Font Name','Arial',...
		'position',[550,170,555,175])
add_line(sys,[465,190;475,190])
add_line(sys,[375,210;390,210])
add_line(sys,[180,130;190,130])
add_line(sys,[180,175;190,175])
add_line(sys,[180,290;190,290])
add_line(sys,[180,245;190,245])
add_line(sys,[230,290;245,290])
add_line(sys,[325,210;335,210])
add_line(sys,[540,190;545,190;545,125;375,125;375,190;390,190])
add_line(sys,[440,60;135,60;135,165;155,165])
add_line(sys,[335,80;145,80;155,120])
add_line(sys,[335,360;135,360;135,255;155,255])
add_line(sys,[440,340;145,340;155,300])
add_line(sys,[60,95;90,95])
add_line(sys,[60,140;90,140])
add_line(sys,[130,140;155,140])
add_line(sys,[60,185;90,185])
add_line(sys,[130,185;155,185])
add_line(sys,[130,235;155,235])
add_line(sys,[130,280;155,280])
add_line(sys,[80,185;90,235])
add_line(sys,[390,80;375,80])
add_line(sys,[490,60;480,60])
add_line(sys,[390,360;375,360])
add_line(sys,[490,340;480,340])
add_line(sys,[230,175;230,145;245,145])
add_line(sys,[230,130;245,130])
add_line(sys,[130,95;230,95;230,115;245,115])
add_line(sys,[390,40;375,40])
add_line(sys,[545,125;545,40;430,40])
add_line(sys,[495,15;520,15])
add_line(sys,[465,210;560,210;560,340;530,340])
add_line(sys,[465,190;465,235;575,235;575,360;430,360])
add_line(sys,[560,210;560,80;430,80])
add_line(sys,[575,235;575,60;530,60])
add_line(sys,[335,40;305,40])
add_line(sys,[180,245;180,385;195,385])
add_line(sys,[230,245;230,270;245,270])
add_line(sys,[240,40;235,40;245,100])
add_line(sys,[130,325;230,325;230,310;245,310])
add_line(sys,[60,95;60,325;90,325])
add_line(sys,[70,140;70,280;90,280])
add_line(sys,[315,40;315,15;190,15])
add_line(sys,[275,125;280,125;280,200;300,200])
add_line(sys,[275,290;280,290;280,220;300,220])

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
