This preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full DocumentThis preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
Unformatted text preview: d=logspace(1,3,4) %% problem 3 x = linspace(0.988, 1.012, 241); y1 = x.^7  7*x.^6 + 21*x.^5  35*x.^4 + 35*x.^3  21*x.^2 + 7*x  1; y2 = (x1).^7; plot(x,y1,'b', x,y2,'r'); %% Practice Exercise 2.4 a=[2.3 5.8 9] sin(a) a+3 b=[5.2 3.14 2] a+b a.*b a.^2 c=0:10 d=0:2:10 linspace(10,20,6) logspace(1,2,5) %% Problem 2.12 g=9.8; t=0:10:100; d=1/2*g*t.^2; table=[t',d'] %% Problem 2.8 % a) r=3; h=[1,5,12]; volume = pi*r^2.*h % use the .* operator since h is an array % b) b=[ 2, 4, 6]; h=12; area=1/2*b.*h area=1./2.*b.*h % both works % c) h=6; volume=h.*area %% Problem 2.17 D=0:10:180; R=D*pi/180; D_to_R=[D',R'] save degrees.dat ascii D_to_R %Check your current directory to confirm that the file was saved clear load degrees.dat degrees...
View
Full Document
 Fall '11
 YunJiang
 Row vector

Click to edit the document details