Contents
Aaron Klapheck
clear, clc
Date = date
Date =
22-Oct-2007
Problem 14
Percentage_of_Water_Loss(50,10^7);
Warning: The value of local variables may have been changed to match the
globals. Future versions of MATLAB will require that you declare
a variable to be global before you use that variable.
Warning: The value of local variables may have been changed to match the
globals. Future versions of MATLAB will require that you declare
a variable to be global before you use that variable.
Days_Needed =
54.1832
Problem 16a (compute V & A for a between 0.25 & 4 and b = a + 2)
a = linspace(0.25, 4, 20);
b = a + 2;
[Area_of_Torus, Volume_of_Torus] = V_and_A(a,b)
Area_of_Torus =
Columns 1 through 9
49.3480 57.1398 64.9316 72.7234 80.5152 88.3070 96.0988 103.8906 111.6824
Columns 10 through 18
119.4742 127.2660 135.0577 142.8495 150.6413 158.4331 166.2249 174.0167 181.8085
Columns 19 through 20
189.6003 197.3921
Volume_of_Torus =
Columns 1 through 9
24.6740 28.5699 32.4658 36.3617 40.2576 44.1535 48.0494 51.9453 55.8412
Columns 10 through 18
59.7371 63.6330 67.5289 71.4248 75.3207 79.2166 83.1125 87.0084 90.9043
Columns 19 through 20
94.8001 98.6960
Problem 20b
poly = @(x) (20*x.^2 - 200.*x + 3)
interval = [-50:1:50];
plot(interval, poly(interval));
[position, value] = fminbnd(poly,0,8)
poly =
@(x) (20*x.^2 - 200.*x + 3)
position =
5.0000
value =
-497
Problem 23
f1 = Minimum_of_f1(20, 200, 3);
[x_value, y_value] = fminbnd(f1, 0, 10)
x_value =
5.0000
y_value =
-497
Problem 24
load matrix.txt
matrix
Mean_Value_of_Each_Column = mean(matrix, 1)
matrix =
55 42 98
51 39 95
63 43 94
58 45 90
Mean_Value_of_Each_Column =
56.7500 42.2500 94.2500
Problem 25
A = xlsread('matrix_1')
Sum_of_Each_Column = sum(A)
A =
55 42 98
51 39 95
63 43 94
58 45 90
Sum_of_Each_Column =
227 169 377
The PDF version may be
easier to understand, because it contains all the functions called in this program.