## MATLAB INTRODUCTION

No knowledge of any specific computer program is needed for this course, but        matlab        is a particularly appropriate program for checking your work in this part of the course.

I don't want to lecture on use of        matlab,        but here are some very primitive instructions on getting started if you are in a Unix environment and on getting the row-reduced echelon form of a matrix. NONE OF THIS IS REQUIRED AND YOU ARE WELCOME TO USE ANY LINEAR ALGEBRA PROGRAM YOU WANT TO CHECK YOUR WORK. My comments are preceded by % signs.

% Type        matlab        at the prompt ---
% you will see something like this:

zariski:hochster% matlab

< M A T L A B >
Version 5.3.0.10183 (R11)
Jan 21 1999

To get started, type one of these: helpwin, helpdesk, or demo.
For product information, type tour or visit www.mathworks.com.

>>

% The >> is a prompt. You can feed in a matrix at
% the prompt by typing

>> A = [1 2 3; 4 5 6]

% The semi-colons     ;     separate rows.
% Spaces or commas can be used to separate entries of
% one row. If you type in the above (and hit Return) you
% will see this:

>> A = [1 2 3; 4 5 6]

A =

1       2        3
4       5        6

>>

% Now, if you want to get the reduced row echelon form of A
% type in     rref(A)     at the prompt (and hit Return):

>> rref(A)

ans =

1       0      -1
0       1        2

% An alternative is to name the answer for future manipulations
% yourself, e.g. type in B = rref(A) (and hit return)

>> B = rref(A)

B =

1       0      -1
0       1        2

>>

% The product of two matrices A,B can be entered as A*B,
% and the inverse of the square matrix A as inv(A).

% det(A) produces the determinant of the
% square matrix A.

% norm(A) produces the length of the
& row or column vector A.

% A' produces the transpose of the
% matrix A, i.e. the same matrix but
% with the rows and columns interchanged.
% If A is 3 by 5 then A' is 5 by 3.
% For example if A is

% 1 2 3
% 4 5 6

% then A' is

% 1 4
% 2 5
% 3 6

% The dot product of two vectors A and B
% can be obtained by using transposes suitably
% so that the first becomes a row and the second
% a column, and then using * . E.g., for two
% rows the dot product is A*B' while for
% two columns the dot product is A'*B.

% null(A) produces a basis for the
% kernel (also called the nullspace)
% of A consisting of mutually
% perpendicular (= orthogonal) vectors
% of length 1. This means that what
% is standardly produced will only be
% correct to 4 decimal places and
% fractions are typically introduced
% even when that is not necessary.

% That's all for now.