PRACTICAL MATLAB® FOR ENGINEERS PRACTICAL MATLAB

(sharon) #1

96 Practical MATLAB® Applications for Engineers


P.1.17 Write a program that returns the plots over three cycles of the following periodic
functions, defi ned as follows over one period (T = 2 ):


ƒ 1 (t) = t, for 0 < t < 2


ƒ 2 (t) = −t + 2 , for 0 < t < 2


ft

t

(^3) t


20 1


01 2


()











fn

t

(^4) t


10 1


21 2


()











ƒ 5 (t) = 2 + t, 0 < t < 2


ƒ 6 (t) = −t + 4, 0 < t < 2


P.1.18 Sketch by hand each of the functions defi ned in P.1.13.


P.1.19 Sketch by hand the even and odd portions of each of the functions defi ned in P.1.13.


P. 1. 2 0 L e t f(t) be a periodic function with period T = 2 , defi ned as follows by


ft

tt
t

()





01


11 2





a. Manually sketch f(t) over three periods
b. Write a program that returns the plots of part a
c. Sketch by hand f(−t)
d. Write a program that returns the plot of part c
e. Sketch by hand [f 1 (t) = −f(−t) + f(t)] versus t, over the range − 3 ≤ t ≤ + 3
f. Write a program that returns the plot of part e
g. Sketch f 2 (t) = _^12 [f(t) + f(−t)] versus t and f 3 (t) = 12 _ [f(t) − f(−t)] versus t, over the
range − 3 ≤ t ≤ + 3
h. Sketch by hand [f 4 (t) = f 2 (t) + f 3 (t)] versus t

P. 1. 2 1 M o d i f y t h e s c r i p t fi le even_odd.m (of Example 1.14) into a function fi le where the
input is the function f(t), over a given range r, and its outputs are the plots of the even
and odd parts of f(t).


P.1.22 Test the function fi le even_odd.m created in P.1.21, over the range − 10 ≤ t ≤ 10 , using
the following function:
a. f 1 (t) = cos(3t + pi/3)u(t)
b. f 2 (t) = t u(t)
c. f 3 (t) = t u(t) − t u(t − 5)


P. 1. 2 3 L e t f(t) = 3r(t) − 3r(t − 1) + 3r(t − 2), sketch and obtain MATLAB plots, over the
range − 5 ≤ t ≤ 5 , for the following functions:
a. f(t) versus t
b. fe(t) versus t
c. fo(t) versus t

Free download pdf