# matlab5 - Solutions to Problems in Chapter Five Test Your...

This preview shows pages 1–10. Sign up to view the full content.

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Solutions to Problems in Chapter Five Test Your Understanding Problems T5.1-1 The session is x = [0:0.1:35]; y = 0.4*sqrt(1.8*x); plot(x,y),xlabel( Distance (miles) ), ... ylabel( Height (miles) ),axis([0 35 0 3.5]),... title( Rocket Height as a Function of Downrange Distance ) The plot is shown in the figure. 5 10 15 20 25 30 35 0.5 1 1.5 2 2.5 3 3.5 Distance (miles) Height (miles) Rocket Height as a Function of Downrange Distance Figure : for Problem T5.1-1. 5-1 T5.1-2 The session is x = [0:0.01:2*pi]; f = tan(cos(x))-sin(tan(x)) ; fplot(f,[0 2*pi]) [x,y] = fplot(f,[0 2*pi]); size(x) ans = 292 1 The plot shown in the figure was generated with the fplot command. It would take 292 values of x to obtain the same plot using the plot command. 1 2 3 4 5 6-2-1.5-1-0.5 0.5 1 1.5 2 Figure : for Problem T5.1-2. 5-2 T5.1-3 The session is z = 0.2+.8i; n = [0:0.01:20]; plot(z.^n),xlabel( Real ),ylabel( Imaginary ),... title( Plot of (0.2+0.8i)^n for n = [0,20] ),... axis([-1 1 -1 1]) The plot is shown in the figure.-1-0.8-0.6-0.4-0.2 0.2 0.4 0.6 0.8 1-1-0.8-0.6-0.4-0.2 0.2 0.4 0.6 0.8 1 Real Imaginary Plot of (0.2+0.8i)^n for n = [0,20] Figure : for Problem T5.1-3. 5-3 T5.2-1 The session is t = [0:0.01:8];v = [-8:0.01:8]; z = exp(-.5*t).*cos(20*t-6); u = 6*log10(v.^2+20); subplot(2,1,1) plot(t,z),xlabel( t ),ylabel( z ) subplot(2,1,2) plot(v,u),xlabel( v ),ylabel( u ) The plots are shown in the figure. 1 2 3 4 5 6 7 8-1-0.5 0.5 1 t z-8-6-4-2 2 4 6 8 7 8 9 10 11 12 v u Figure : for Problem T5.2-1. 5-4 T5.2-2 The session is x = [0:5];y1 = [11,13,8,7,5,9]; y2 = [2,4,5,3,2,4]; plot(x,y1, * ,x,y2, + ,x,y1,x,y2,-- ),... xlabel( x ),ylabel( y1, y2 ),... legend( y1 , y2 ) Note that the legend command acts on the first two pairs in the plot command. The plot is shown in the figure. y1 y2 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 2 4 6 8 10 12 14 x y1, y2 Figure : for Problem T5.2-2. 5-5 T5.2-3 The session is x = [0:0.01:2]; y1 = cosh(x);y2 = 0.5*exp(x); plot(x,y1,x,y2, -- ),xlabel( x ),ylabel( y ),... legend( cosh(x) , 0.5exp(x) ) The plot is shown in the figure. cosh(x) 0.5exp(x) 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0.5 1 1.5 2 2.5 3 3.5 4 x y Figure : for Problem T5.2-3. 5-6 T5.2-4 The session is x = [0:0.01:2]; y1 = sinh(x);y2 = 0.5*exp(x); plot(x,y1,x,y2),xlabel( x ),ylabel( y ),... gtext( sinh(x) ),gtext( 0.5exp(x) ) The plot is shown in the figure. 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 0.5 1 1.5 2 2.5 3 3.5 4 x y sinh(x) 0.5exp(x) Figure : for Problem T5.2-4. 5-7 T5.2-5 The session is x = [0:0.01:1]; y1 = sin(x);y2 = x-x.^3/3; plot(x,y1),gtext( sin(x) ),hold,plot(x,y2),xlabel ( x ),ylabel( y ),... gtext( x-x^3/3 ) The plot is shown in the figure. Note that the order of the gtext commands is important....
View Full Document

## This note was uploaded on 04/12/2010 for the course ENG 121 taught by Professor Smith during the Spring '08 term at The School of the Art Institute of Chicago.

### Page1 / 82

matlab5 - Solutions to Problems in Chapter Five Test Your...

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

View Full Document
Ask a homework question - tutors are online