Fall 2017 MATLAB Assignment C: OUTPUTS Math 152-5xx, Team A, #0 Your Name, UIN 123456789 Gilat 5th Edition, Chapter 4 Page 123, Problem 2 Description % code format short g F=100000; N=5:1:10; r=4.35/100; P=F*(r/12)./((1+r/12).^(12*N)-1); T=[N' P']; disp(' Number of years Montly Deposit') Number of years Montly Deposit disp(T) 5 1495 6 1218 7 1020.6 8 872.78 9 758.13 10 666.67 Page 124, Problem 4 Description % code clear r2=12:4:28; r1=0.7*r2; V=1/4*pi^2*(r1+r2).*(r2-r1).^2; S=pi^2*(r2.^2-r1.^2); T=[r2' r1' V' S']; disp(' r2 r1 V S') r2 r1 V S disp(T) 12 8.4 652.34 724.82 16 11.2 1546.3 1288.6 20 14 3020.1 2013.4 24 16.8 5218.7 2899.3
12
Embed
Gilat 5th Edition, Chapter 4 Fall 2017 MATLAB Assignment C: OUTPUTSrlan/math152_F2017/M152C.pdf · Fall 2017 MATLAB Assignment C: OUTPUTS Math 152-5xx, Team A, #0 Your Name, UIN 123456789
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Fall 2017 MATLAB Assignment C: OUTPUTS
Math 152-5xx, Team A, #0 Your Name, UIN 123456789
Gilat 5th Edition, Chapter 4
Page 123, Problem 2
Description
% codeformat short gF=100000;N=5:1:10;r=4.35/100;P=F*(r/12)./((1+r/12).^(12*N)-1);T=[N' P'];disp(' Number of years Montly Deposit')
% codea=5:0.25:100;b=2*(sqrt(55^2-(a/2).^2));S=(a-2*4).*(b-2*10);[maxS,ind]=max(S);maxa=a(ind);maxb=b(ind);fprintf('The area of the lagest rectanlge is %.2f when a is %.2f and b is %.2f.\n', maxS, maxa, maxb)
The area of the lagest rectanlge is 4051.88 when a is 74.50 and b is 80.93.
Page 127, Problem 15
Description
% codeh=900; H=70;x=50:0.5:1500;al=atan((h-H)./x);be=atan(h./x);theta=be-al;[maxth,i]=max(theta);fprintf('The largest value of theta %.3f when x is %.2f', maxth, x(i))