%Defining model parameters:
tu=0; %Time of step in u
u0=0; %Value of u before the step
u1=1; %Value of u after the step

%s-transfer function, Hc:
a2=1; a1=2; a0=4; b1=0.5; b0=0;
num_Hc=[b1,b0];
den_Hc=[a2,a1,a0];

%z-transfer function, Hd:
c2=5; c1=3; c0=1; d1=1; d0=0;
num_Hd=[d1,d0];
den_Hd=[c2,c1,c0];
h1=0.1; %Sampling time

%Continuous-time state-space model
Ac=[0,1;-2,-3]; Bc=[0;4]; Cc=[1,0]; Dc=[0];
xc0=[1,2]; %Initial state

%Discrete-time state-space model
Ad=[1,0.2;-0.3,-0.8]; Bd=[0;0.5]; Cd=[1,0]; Dd=[0];
xd0=[3;4]; %Initial state
h2=0.2; %Sampling time

%LTI model (same as Hc defined above):
Hc=tf(num_Hc,den_Hc);

%Setting simulation parameters:
timestep=0.01;
options=simset('solver','ode5','fixedstep',timestep); 
tstop=10;

%Simulates sys2.mdl:
sim('sys2',tstop,options)