Professional Documents
Culture Documents
GENG 300
Lab Report # 2
Section: Tuesday - Evening
Group No.
Fall 2015
GENG 300
Assignment 2
A2-1. Plot t versus v with line width 1.5, dotted, red
colored line, triangle shaped, marker with size 10,
black edge, and green face.
>> 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)
>> hold on
>> plot(t,v, 'o')
>> hold off
>> title ('Plot of v versus t')
>> xlabel('Values of t')
>> ylabel('Values of v')
>> grid
>> plot (t,v, ':^r', 'Linewidth', 1.5, 'MarkerSize' , 10, 'MarkerEdgeColor', 'k', 'MarkerFaceColor', 'g')
A2-2. a. Determine the drag coefficient (cd) using the equation: = 2 from the exploratory
83.6
53.4
60.2
48.5
72.1
50.9
Hints: m= [83.6
60.2
72.1
91.1
92.9
65.3
72.1
91.1
92.9
65.3
80.9]
80.9
51.1
80.9]
m=
Columns 1 through 5
Fall 2015
GENG 300
Columns 6 through 7
65.3000 80.9000
v=
Columns 1 through 5
Columns 6 through 7
47.7000 51.1000
cd =
Fall 2015
GENG 300
Columns 1 through 5
0.2876
0.2511
0.2730
0.2860
0.3125
Columns 6 through 7
0.2815
0.3039
b. Find out average, maximum, and minimum of cd by the command mean(cd), max(cd),
and min(cd) respectively.
>> mean(cd)
ans =
0.2851
>> max(cd)
ans =
0.3125
>> min(cd)
ans =
Fall 2015
GENG 300
0.2511
>> cdavg=mean(cd)
cdavg =
0.2851
>> pred=sqrt(g*m/cdavg)
pred =
Columns 1 through 5
Columns 6 through 7
47.4018 52.7610
Fall 2015
GENG 300
>> F
F =
15.0363
function F = future( p,i,n )
%UNTITLED10 Summary of this function goes here
%
Detailed explanation goes here
F=p*(1+i)^n
end
>> future(100000,0.06,7)
F =
1.5036e+05
ans =
1.5036e+05
A2-4. Using input and disp function, find out the value of Future worth (F) of A2-3 (use only script
file)
Fall 2015
GENG 300
A2-5. Rearrange mass (m) and Velocity (v) of A2-2 in two columns as appropriate using fprintf
function.
function mv
m=[83.6 60.2 72.1 91.1 92.9 65.3 80.9];
v=[53.4 48.5 50.9 55.9 54 47.7 51.1];
z=[m;v];
fprintf(' mass
velocity\n');
fprintf('%7.2f %7.2f\n',z);
end
>> mv
mass velocity
83.60 53.40
60.20 48.50
72.10 50.90
91.10 55.90
92.90 54.00
65.30 47.70
80.90 51.10
Fall 2015