40 Practical MATLAB® Applications for Engineers
title (‘2 triangular cycles’);
axis ([0 1 -0.5 1.5]);
ylabel (‘Amplitude’) ;
xlabel (‘time’);The script fi le triang_pulses is executed and the results are shown in Figure 1.36.R.1.119 Recall that system concepts such as transfer function, fi lter, and input and output
signals were introduced in Chapter 7 of the book titled Practical MATLAB® Basics
for Engineers.
The MATLAB command [h, t] = impulse(P, Q, t) returns as output h, when the
input is a Dirac impulse applied to a fi lter or system whose transfer function is
given by P/Q, where P and Q are polynomials expressed as row arrays whose coef-
fi cients are arranged in descending order of s (where s = jw is the Laplace variable)
and t is the time interval of interest (see Chapter 4 for more information).
R.1.120 The MATLAB command [gs, t] = step(P, Q, t) returns the step response of a linear
system with a transfer function defi ned by H = P/Q, over a time interval t.
R.1.121 The MATLAB function hn = dimpulse(P, Q, n) returns the discrete impulse response
consisting of n samples, applied to the discrete transfer function H(z) = P(z)/Q(z),
where P(z) and Q(z) represent the vector polynomial consisting of its coeffi cients
arranged in decreasing powers of z, where z = ejw.*
*^ See Chapter 5 for more information about z.
3 triangular cycles5 triangular cycles4 triangular cycles2 triangular cycles1.50.51.5 1.5110.510−0.50.5−0.501AmplitudeAmplitude AmplitudeAmplitude000.50.5111.50.5−0.5
0.5^100100−0.5
0.5
time timeFIGURE 1.36
Plots of R.1.118.