PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

Time Domain Representation of Continuous and Discrete Signals 15


the system differential equation.* Note also that when b is complex, then by Euler’s
equalities f(t) presents oscillations.
Finally, the more common equation f(t) = Ae−bt u(t) is defi ned analytically by

ft

Ae t
t

bt
()

 





for
for

0


00





R.1.36 An exponential sequence can be defi ned by f(n) = A an, for −∞ ≤ n ≤ ∞, where a can
be a real or complex number.
R.1.37 The following example illustrates the form of an exponential function for various
values for A and b.
Let us explore the behavior of the exponential function, by creating the script fi le
exponentials that returns the following plots:
a. f 1 (t) = 4e(−t/2)
b. f 2 (t) = 4e(t/ 2)
c. f 3 (t) = 4e(−t/2)u(t)
d. f 4 (t) = −4e(t/ 2)u(t)
for A = ± 4 and b = ±1/2, over the range − 3 ≤ t ≤ 3 , using 61 elements.
MATLAB Solution
% Script file: exponentials
t = -3:.1:3;
ft1 = 4*exp(-t./2);
ft2 = 4*exp(t./2);
ut _ 1 = [zeros(1,30) ones(1,31)]; % step with 61 elements
ft3 = ft1.*ut _ 1;
subplot(2,2,1);
plot(t, ft1);
axis([-3 3 -.5 18]);xlabel(‘t (time)’)
title(‘f1(t)=4*exp(-t/2) vs. t’);
ylabel(‘Amplitude [f1(t)]’)
subplot(2,2,2);
plot(t, ft2); xlabel(‘t (time)’)
axis([-3 3 0 20]);
title(‘f2(t) = 4*exp(t/2) vs. t’);
ylabel(‘Amplitude [f2(t)]’);
subplot(2,2,3);
plot(t, ft3);
axis([-3 3 -.5 5]);
title(‘f3(t) =4*exp(-t/2)*u(t) vs. t’);
xlabel(‘t (time)’)
ylabel(‘Amplitude[f3(t)]’);
subplot(2,2,4);
ft4 =-1.*ft2.*ut _ 1;
plot(t, ft4);
axis([-3 3 -20 1]);
title(‘f4(t) = -4*exp(-t/2)*u(t) vs. t’)
xlabel(‘t (time)’); ylabel(‘Amplitude[f4(t)]’);

The script fi le exponentials is executed and the results are shown in Figure 1.17.

*^ See Chapter 7, Practical MATLAB® Basics for Engineers.
Free download pdf