Matlab ReadMe for Lay's Toolbox
for
Linear Algebra and Its Applications, Updated Second Edition
by
David C. Lay
Addison-Wesley Publishing Company, 2000

ATTENTION: For important user notice about using Matlab with Office 97,
please visit http://www.mathworks.com/support/solutions/v5/7459.html

The M-files in Lay's Toolbox are not part of commercial MATLAB, so 
you must install them.  The idea is to copy the files into a new 
folder inside the MATLAB folder, and then append the address of the 
new directory to the MATLAB path.  

These files are intended for use with Matlab 5, 4, or 3.5.
PLEASE NOTE: There is a separate subdirectory of files required for
Matlab 3.5.  Details are described in the installation instructions
below.

The M-files in the Toolbox are designed to accompany Linear Algebra 
and Its Applications, Updated Second Edition, by David C. Lay, 
Addison-Wesley Publishing Co., Reading, Massachusetts, 2000.  The 
Toolbox includes data for over 800 numerical exercises from 
the text, along with custom programs and M-files that will help 
the student learn fundamental concepts of linear algebra. The 
simple MATLAB(R) commands needed are explained in the Study Guide 
that accompanies the text.

Numerical data in the Toolbox is organized by sections in the 
text.  For instance, after you have completely installed Lay's 
Toolbox, you can open MATLAB and type c3s1 to obtain the data 
for exercises in Chapter 3, Section 1. You will receive a prompt, 
asking which exercise you wish to study.  

The following supplementary commands work the same as other MATLAB 
commands. The MATLAB "help" command will provide more detail about the 
commands. Type help name, where "name" is the MATLAB command.          

Supplementary MATLAB Commands (M-files)

bgauss - (Backward gauss) Uses the leftmost nonzero entry in a 
selected row as the pivot, and creates zeros in the pivot column 
above the pivot entry.

gauss - Uses the leftmost nonzero entry in a selected row 
as the pivot, and creates zeros in the pivot column, below the 
pivot entry or in specified rows.

gs - Performs the Gram-Schmidt process on the columns of a 
matrix.  The columns need not be linearly independent.

nulbasis - Creates a basis for the null space of a given matrix.

proj - Computes the orthogonal projection onto a subspace.

randint - Creates a matrix with random integer entries.

randstoc - Creates a random stochastic matrix.

ref - Computes the reduced echelon form of a matrix.

replace - Performs one row replacement operation.

scale - Scales one row of a matrix.

swap - Interchanges two rows of a matrix.

--------------------------------------------------------------
INSTALLING FILES INTO THE MATLAB PATH

If you want to use M-files that are not part of commercial MATLAB, 
such as those in Lay's Toolbox, you must tell MATLAB where to look for 
them.  You can access Lay's Toolbox on the CD-ROM that comes with the 
book or on the Web site at http://www.laylinalgebra.com. 

FIRST: Create a folder called laydata on your desktop.
Download the Lay's Toolbox from the CD-ROM or Web site.
Unstuff the compressed archive.
Place the unstuffed M-files in this laydata folder on your desktop.  


A.  FOR MACINTOSH:  Drag the icon for the laydata folder into your 
MATLAB folder on your hard drive.  Open MATLAB.  From the File menu, 
select Open. Select one of the M-files from the laydata folder 
(to open the file as if for editing), then close the file.  After 
this, MATLAB will always know to look in that laydata folder.  
 

B.  FOR WINDOWS:  First copy the laydata folder into your MATLAB folder.
Now you have a copy of the laydata folder at the address 
c:\matlab\laydata.

Now you must tell MATLAB to look in that new folder.  There is a 
MATLAB command called path which outputs a long string that contains
the addresses of all the folders where MATLAB looks for M-files, and 
you need to adjoin the address of your new laydata folder to that 
string.  (If you have started MATLAB, you can see the present contents
of that string at any time by typing path.)  

1.  If you have Student MATLAB 5, start it.  Then click on the 
"Path Browser" icon at the top of the screen.  (This icon has two 
folders on it.)  This opens a small screen called "MATLAB Path."  
Click the button  "Add to Path."  Click the button  "Browse" (it may 
be a button with "..." on it), then click on  C:, then on  Matlab, and 
then click on laydata to highlight it.  Click the button "OK," which 
returns you to the Matlab Path screen.  Click the button "Save 
Settings" or choose "Save Path" from the File menu, then close the 
window.

From now on, the new path will be in effect.  That is, whenever you 
use MATLAB, it will look for M-files in  c:\matlab\laydata  as well as 
in all the other folders which were in the path originally.   

2.  If you have Student MATLAB 4, open Windows, then click  
Start/Find/Files or Folders  and locate the file matlabrc.m .  Double 
click on its name to open it for editing.  Scroll down about 75 
lines until you see lines that look like  

';C:\MATLAB\toolbox\sigsys',...
]);

Insert a new line between these two, so the lines now look like

';C:\MATLAB\toolbox\sigsys',...
';C:\MATLAB\laydata',...
]);

Save the file and then close the Edit screen.  

From now on, whenever you start MATLAB, it will look for M-files in  
c:\matlab\laydata as well as in all the other folders which were in 
the path originally.   If MATLAB is currently running, type  
matlabrc to establish the new path for the current session.  

3. Strange things happen occasionally on some computers.  If for some 
reason neither of the above methods works, the following will always 
work, but it only adds your new folder to the path for the current 
session.  That is, this method has to be repeated each time you start 
MATLAB.   Start MATLAB and type the appropriate one of the following 
commands:   

In MATLAB 5, type    addpath  'c:\matlab\laydata'  
In MATLAB 4, type    path(path, 'c:\matlab\laydata')  
In MATLAB 3.5, type   matlabpath( [matlabpath, 'c:\matlab\laydata'] )  


C. If you use MATLAB ON A NETWORK, ask the system administrator to 
store your files and adjoin their address to MATLAB's path.  

D. FOR DOS: If you are using MS-DOS, you must add the name of the
laydata directory to the MATLAB path, by editing the file MATLAB.BAT, 
in the MATLAB\MATLAB subdirectory.  Locate the line that begins:

        SET MATLABPATH=\MATLAB\MATLAB;\MATLAB\DEMO

and at the end of this line, add:       ;\MATLAB\LAYDATA 

--------------------------------------------------------------
The author and  Addison-Wesley Publishing Company  make no 
representation or warranty of any kind, expressed or implied, with 
regard to the programs contained herein, including without limitations 
any implied warranties of merchantability or fitness for particular 
purposes,  all of which are expressly  disclaimed.  The author and  
Addison-Wesley  Publishing  Company shall not be liable for incidental 
or consequential damages in connection with or arising out of the use 
of these programs.
 
AL
April 1999