You are on page 1of 7

A2-1

t=0:2:20; m=68.1; cd=0.25;g=9.81;

v=sqrt(g*m/cd)*tanh(sqrt(g*cd/m)*t);

plot(t,v,':^','Linewidth',1.5, 'Markersize',10,'MarkerEdgeColor','k','MarkerFaceColor','g')

A2-2

>> cd=g*m./(v.^2);

g=9.81;

m=[83 60 72 91 92 65 80];

v=[53.4 48.5 50.9 55.9 54 47.7 51.1];

>> cd=g*m./(v.^2)

g=9.81

m=[83 60 72 91 92 65 80]

v=[53.4 48.5 50.9 55.9 54 47.7 51.1]


cd =

0.2855 0.2502 0.2726 0.2857 0.3095 0.2802 0.3006

g=

9.8100

m=

83 60 72 91 92 65 80

v=

53.4000 48.5000 50.9000 55.9000 54.0000 47.7000 51.1000

b.

>> mean(cd)

ans =

0.2835

>> max(cd)

ans =
0.3095

>> min(cd)

ans =

0.2502

c.

>> cdavg= mean(cd)

cdavg =

0.2835

>> vpred=sqrt((g*m)/cdavg)

vpred =

53.5932 45.5666 49.9157 56.1166 56.4241 47.4272 52.6157


d.

>> subplot(2,1,1);plot(v,vpred,'o')

>> subplot(2,1,2);plot(cd,m,'d')

A2-3

P=200000;

i=0.07;

n=8;

F = P*(1+i)^n;

>> F

F=

3.4364e+05
function [ F ] = function1( P,i,n)

%UNTITLED6 Summary of this functiongoes here

% Detailed explanation goes here

F=P*((1+i)^n);

end

>> function1(200000,0.07,8)

ans =

3.4364e+05

A2-4

P=input('Money: ');

i=input('Interest rate: ');

n=input('number of Years: ');

disp(' ');

disp('Future worth (F): ');


disp(P*(1+i)^n)

>> FutureWorth

Money: 200000

Interest rate: 0.07

number of Years: 8

Future worth (F):

3.4364e+05

A2-5

function mv

m=[83 60 72 91 92 65 80];

v=[53.4 48.5 50.9 55.9 54 47.7 51.1];

z=[m;v];

fprintf(' m v\n');

fprintf('%7d %10.2f\n',z);

end

>> mv

m v

83 53.40

60 48.50

72 50.90

91 55.90
92 54.00

65 47.70

80 51.10

You might also like