Chap1_plotting_sol

Chap1_plotting_sol - 2. The following commands were saved...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 2. The following commands were saved in an M-file: % a) t1 = -8:-4; x1 = zeros(size(t1)); t2 = -4:3; x2 = t2+2; t3 = 3:8; x3 = t3-2; t = [t1 t2 t3]; x = [x1 x2 x3]; subplot(221),plot(t,x) xlabel( 'Time (sec)' ) ylabel( 'x(t)' ) title( 'a)' ) % b) t = t+1; subplot(222),plot(t,x) xlabel( 'Time (sec)' ) ylabel( 'x(t)' ) title( 'b)' ) % c) n1 = -6:1; x1 = zeros(size(n1)); n2 = 2:3; x2 = 2*n2-4; n3 = 4:8; x3 = 4-n3; n = [n1 n2 n3]; x = [x1 x2 x3]; subplot(223),stem(n,x) xlabel( 'n' ) ylabel( 'x[n]' ) title( 'c)' ) % d) n = n-1; subplot(224),stem(n,x) xlabel( 'n' ) ylabel( 'x[n]' ) title( 'd)' ),subplot(111) -10-5 5 10-2 2 4 6 Time (sec) x(t) a)-10-5 5 10-2 2 4 6 Time (sec) x(t) b)-10-5 5 10-4-2 2 n x[n] c)-10-5 5 10-4-2 2 n x[n] d) 3. 0.5 1 1.5 2-4-2 2 4 Time (sec) x(t) 1 a) 5 10-4-2 2 4 Time (sec) x[n] 1 b) 20 40 60-2-1 1 2 Time (sec) x(t) 1 c)-2 2 4 6-4-2 2 4 Time (sec) x(t) 1 d) 5 10 15 20-4-2 2 4 Time (sec) x(t) 1 e)-10-5 5 10-2 2 4 6 Time (sec) x(t) 1 f) Here is an M-file that contains the script to plot generate these plots:...
View Full Document

This document was uploaded on 10/24/2010.

Page1 / 5

Chap1_plotting_sol - 2. The following commands were saved...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online