HMC Math 73: Linear Algebra (Spring, 1999)
How to use MATLAB and m-files on KATO
Here are instructions for running MATLAB, creating m-files, storing a diary, and sending them to the grader using the PC system "KATO". Everybody should have a KATO account (or be able to get one). I tried this myself in the PC lab in Parsons and it seemed to work, so I'm assuming (hoping?) it will work for anyone. Even if you've gotten m-files to work in the past, you may want to try this as an easy alternative.
If you have any ideas about that last matter, or have any questions or comments about the above, feel free to e-mail me, and I'll try to keep this page current with helpful hints and what I know works. Also, just drop me a line the first time you use the above, even if you didn't have any trouble, to let me know that the instructions are useful and functioning more or less as advertised. Thanks.
- Log on to the PC network ("KATO"), either from a PC lab (like Parsons 146) or from your dorm room, if that works.
- Once logged on, there should be an Application Launcher on your desktop, and the h:\ drive should point at your home directory on KATO.
- In the h:\ drive root, create a folder called matlab (or some such) to store your m-files and diaries.
- Start the Application Launcher, then choose "Mathlab52" from the "Math" group. (Note: avoid MATLAB5... I had some trouble with it)
- MATLAB for the PC has its own m-file (text) editor, so you can use it to add "h:\matlab" to MATLAB's search path, and to create and edit "det3.m" (or whatever) in this directory. You can also use the addpath command to add the path from the MATLAB command line (see "help path"). You can also create and edit the m-file directly in Windows with a standard text editor... just be careful it doesn't actually create "det3.m.txt" if your Windows Explorer is set to hide file extensions. The editor in MATLAB has a build-in visual debugger, though, and so would be my tool of choice.
- NOTE: There has been some troube getting MATLAB to recognize m-files created after MATLAB has been started. As far as I can tell, when a new directory is added to MATLAB's search path or the working directory is set, MATLAB reads the directory immediately, and then never again. As a result, it can fail to recognize that a new file has been added to one of its target directories. To fix this, just use the "cd" command to reset the current working directory (even to the current one). This seems to force MATLAB to reread the directory and recognize the new file.
- Before starting your MATLAB diary, type "cd h:\matlab" at the MATLAB command propt. This changes MATLAB's working directory to your matlab directory, and will cause MATLAB to save the diary file there. You may then start your diary as usual.
- One you're finished with MATLAB and ready to e-mail your m-file and diary to the grader, select "Eudora(K)" from the "NetApps" group in the Application Launcher. This simple mail tool will let you e-mail out a file with the necessary attachments. Find and select "Options..." from one of the pull-down menus (I don't remember which one) to set your return e-mail address for outgoing mail (this will create a mail folder in your h:\ root so, in theory, you should only have to set your e-mail address the first time you use it). Note that Eudora will send e-mail even if you haven't given it your "from" e-mail address.
- Unfortunately, you'll have to use "addpath" and "cd" each time you run MATLAB. For more advanced PC users, it might be possible to create yourself a shortcut to MATLAB in your h:\ root and add these instructions to the shortcut, so that they're set by default when you run it. I don't know if this is possible, and didn't have time to look into it.