02.10.2019 Views

UploadFile_6417

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

16 Chapter 1 INTRODUCTION<br />

1<br />

Stem Plot of sin(0.2 π n)<br />

0.5<br />

x(n)<br />

0<br />

–0.5<br />

FIGURE 1.2<br />

–1<br />

0 5 10 15 20 25 30 35 40<br />

n<br />

Plot of the sin(0.2π n) sequence<br />

displays graphs in Figures 1.1 and 1.2 as one plot, depicting a “sampling”<br />

operation that we will study later.<br />

>> plot(t,xt,’b’); hold on; % Create plot with blue line<br />

>> Hs = stem(n*0.05,xn,’b’,’filled’); % Stem-plot with handle Hs<br />

>> set(Hs,’markersize’,4); hold off; % Change circle size<br />

Another approach is to use the subplot command, which displays<br />

several graphs in each individual set of axes arranged in a grid, using the<br />

parameters in the subplot command. The following fragment (Figure 1.4)<br />

displays graphs in Figure 1.1 and 1.2 as two separate plots in two rows.<br />

. . .<br />

>> subplot(2,1,1); % Two rows, one column, first plot<br />

>> plot(t,x,’b’); % Create plot with blue line<br />

. . .<br />

>> subplot(2,1,2); % Two rows, one column, second plot<br />

>> Hs = stem(n,x,’b’,’filled’); % Stem-plot with handle Hs<br />

. . .<br />

1<br />

Plot of sin(2π t) and its samples<br />

x(t) and x(n)<br />

0.5<br />

0<br />

–0.5<br />

FIGURE 1.3<br />

–1<br />

0 0.5 1 1.5 2<br />

t in sec<br />

Simultaneous plots of x(t) and x(n)<br />

Copyright 2010 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part. Due to electronic rights, some third party content may be suppressed from the eBook and/or eChapter(s).<br />

Editorial review has deemed that any suppressed content does not materially affect the overall learning experience. Cengage Learning reserves the right to remove additional content at any time if subsequent rights restrictions require it.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!