Contents

Aaron Klapheck

% Lab #1
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

% matricies.

A = 3
V = [1, 2, 4]
V_column = [29; 9; 5]
V_column1 = [29
    9
    5]

% display options

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

% Purpose: solve example problem 2.1 without using a transpose opporator

x = linspace(0, 2*pi, 6);
x = x(:);
s = sin(x);
c = cos(x);
t = tan(x);

% method
Method1 = [x s c t]

% method 2
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

% Data

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];

% part a. Find the element in each column that has the largest absolute value.

Max_column_C = max(abs(C))
Max_column_D = max(abs(D))
Max_column_E = max(abs(E))

% part b. Find the value in each matrix that has the largest absolute value.

Max_C = max(Max_column_C)
Max_D = max(Max_column_D)
Max_E = max(Max_column_E)

% part c. Find the value in each matrix that has the smallest absolute value.

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