For the following system Hzzz08 a Plot the response to the i
For the following system: H(z)=(z)/(z-0.8)
(a) Plot the response to the input cos(k* (pi/6) - 0.2) . When plotting the output y(k) it will be instructive to plot the input cosinusoid on the same graph as the output y(k).
Solution
Ans:
Suppose we want to plot the function f(x) = sin(2x) across the interval [0, 1]. In Matlab there are three components to this task.
• A vector of x-values that range across the interval must be set up
0 = x1 < x2 < · · · < xn = 1.
• The function must be evaluated at each x-value:
yk = f(xk), k = 1, . . ., n.
• A polygonal line that connects the points (x1, y1), . . .,(xn, yn) must be displayed. If we take 21 equally spaced x-values, then the result looks like the plot . The plot is “crude” because the polygonal effect is noticeable in regions where the function is changing rapidly. But otherwise the graph looks quite good. Our introduction to Matlab begins with the details of the plotting process and the vector computations that go along with it. The sin(2x) example is used throughout because it is simple and structured. Exploiting that structure leads naturally to some vector operations that are well supported in the Matlab environment.

