
A.8 Time Response 203
are often given as a function of the system's response to test signals such as step,
ramp, or parabolic unit impulse. MATLAB incorporates these test signals, generating
also the system response graphs.
The step response of a system can be obtained by application of the step
command
>> step(sys,t)
where
:∆:
is the time horizon, with
, ∆ and
being the initial, step
and final time. Also it is possible to save the step response by using
>> [y,t,x] = step(sys)
The impulse response can be elicited by application of the impulse command
>> impulse(sys,t)
>> [y,t,x] = impulse(sys)
In case of a general input signal
,
:∆:
the system response is
obtained by using the lsim command, so that
>> lsim(sys,u,t)
>>[y,t,x] = lsim(sys,u,t)
Example
Draw the step response of the system whose function transfer is given by
for 05.
We apply the following list of commands:
>> s=zpk('s');
>> G=10/((s+2)*(s+5));
>> t=0:0.1:5;
>> step(G,t)
>> grid
The step response is plotted in fig. A.11.
Example
Draw the response of the system whose function transfer is given by
for an input signal
2
sin
, 010.
We apply the following list of commands,
>> s=tf('s');
>> G=5/(s^3+2*s^2+s+1);
>> t=0:0.2:30;