Contents
Aaron Klapheck
clear, clc, home
fprintf('The date and time: %s \n', datestr(now))
The date and time: 14-Feb-2008 09:43:48
Assignments given by instructor
A = 3
V = [1, 2, 4]
V_column = [29; 9; 5]
V_column1 = [29
9
5]
fprintf('The value of A is: %3.1f \n', A)
fprintf('The vector V is: [%3.1f %3.1f %3.1f] \n', V)
A =
3
V =
1 2 4
V_column =
29
9
5
V_column1 =
29
9
5
The value of A is: 3.0
The vector V is: [1.0 2.0 4.0]
Problem #8 in section 2.6
x = linspace(0, 2*pi, 6);
x = x(:);
s = sin(x);
c = cos(x);
t = tan(x);
Method1 = [x s c t]
A = Method1;
fprintf('x \t \t \t sin(x) \t cos(x) \t tan(x) \n')
fprintf('%1.5f \t %1.5f \t %1.5f \t %1.5f \n', A)
Method1 =
0 0 1.0000 0
1.2566 0.9511 0.3090 3.0777
2.5133 0.5878 -0.8090 -0.7265
3.7699 -0.5878 -0.8090 0.7265
5.0265 -0.9511 0.3090 -3.0777
6.2832 -0.0000 1.0000 -0.0000
x sin(x) cos(x) tan(x)
0.00000 1.25664 2.51327 3.76991
5.02655 6.28319 0.00000 0.95106
0.58779 -0.58779 -0.95106 -0.00000
1.00000 0.30902 -0.80902 -0.80902
0.30902 1.00000 0.00000 3.07768
-0.72654 0.72654 -3.07768 -0.00000
Problem #20 in section 2.6
C = [(9 + 2), (-2 - 2); (3 - 1), (1 + 1); (-3 + 4), (7 + 4)];
D = [(9 - 2^2), (-2 - 2^2); (3 - 1), (1 + 1); (-3 - 4^2), (7 - 4^2)];
E = [9/2, -2/-2; 3/-1, 1/1; -3/4, 7/4];
Max_column_C = max(abs(C))
Max_column_D = max(abs(D))
Max_column_E = max(abs(E))
Max_C = max(Max_column_C)
Max_D = max(Max_column_D)
Max_E = max(Max_column_E)
Min_C = min(min(abs(C)))
Min_D = min(min(abs(D)))
Min_E = min(min(abs(E)))
Max_column_C =
11 11
Max_column_D =
19 9
Max_column_E =
4.5000 1.7500
Max_C =
11
Max_D =
19
Max_E =
4.5000
Min_C =
1
Min_D =
2
Min_E =
0.7500