Book HW 5 - 8.1 a) balance=1000; For years=[1:10] For...

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

View Full Document Right Arrow Icon
MATLAB Book HW# 5 4.2 a) log(x+x^2+a^2) b) (exp(3*t)+t^2*sin(4*t))*(cos(3*t))^2 c) 4*atan(1) d) sec(x)^2 +cot(x) e) atan(a/x) 4.3 a) m=input(‘enter length in meters: ‘); inches=m*39.37; feet=fix(inches/12); inches=rem(inches, 12);l yards=fix(feet/3); feet=rem(feet, 3); disp( [yards feet inches] ); 4.4 a) m1=input( 'mass of sphere 1' ); m2=input( 'mass of sphere 2' ); a=input( 'direction of the blow making an angle a(in degrees)' ); d=input( 'coefficient of restitution' ); tan(b)=((m2)(1+d)tan(a))/(m1-d(m2)+(m1+(m2))tan(a)^2)
Background image of page 1

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

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

Unformatted text preview: 8.1 a) balance=1000; For years=[1:10] For months=[1:12] Balance=balance*1.01; End Disp( [years balance] ); End 8.2 a) terms=100; Pi=0; Sign=1; For n=1 : terms Pi=pi+sign*4/(2*n-1); End b) terms=100; pi=0; for n=1 : terms pi=pi+8/((4*n-3)*(4*n-1)); end 8.3) a=1 n=6 for i=1:10 n=2*n; a=sqrt(2-sqrt(4-a*a)); l=n*a/2; u=l/sqrt(1-a*a/2); p=(u+1)/2; e=(u-1)/2; disp( [n, p, e] ); end 8.8) sum=0; terms=0; while (sum+terms)<=100 terms=terms+1; sum=sum+terms; end disp( [terms, sum] );...
View Full Document

Page1 / 2

Book HW 5 - 8.1 a) balance=1000; For years=[1:10] For...

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

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