Matlab

Exercises for this course require the use of Matlab or an equivalent language.

The cets virtual lab can be used to run matlab. Performance will vary depending on the speed of the remote network connection. Setup information can be found here.

Matlab is available in the CETS PC labs, which are located in m62, m70, 142 and 144 Towne. For access to m70, 142 and printing, you need an Eniac account, which you can get if you are enrolled is CIS520.

A PC version of Matlab has also been installed (in support of Math 420) in three SAS computer labs: 14 seats in DRL 4N16, 11 seats in High Rise South, and 7 seats in VanPelt College House (NOT the library!).

Accessing course-related Matlab objects

Both homework assignments and Matlab material referenced in the lecture notes will require access to some course-specific files. In order to access these files, you need to add the directory where they are found to your Matlab "path".

In the CETS labs, execute:

path(path,'f:\cis520')
not yet sure for this year

Preparing/saving your work

Matlab is interactive, but you ofen want to store the commands in a script. If you use a text editor (such as emacs or notepad) to create a plain text file called "foo.m" in a directory that is in your matlab path, then if you invoke "foo" at the matlab prompt, it should execute your code. For instance, if foo.m contains just 3*5, executing "foo" will print out

ans =
    15

If you want to control the display a bit more, say to step through your work or to print out commentary, you can use commands like "echo on", "pause", "format compact", "clc" (clear screen), etc.

For instance, if the following file is stored in foo.m, then executing "foo" in Matlab will clear the screen, print three lines of comment, show us what 3*5 is, pause until we hit a key, clear the screen again, print one line of comment, and show us what 4*6 is:

format compact;
clc;
echo on;
%
% This is an example
%    of an executable Matlab file
%    with commentary.
3*5
pause
clc
% This is the second page
4*6

Another solution would be to put your solutions into any sort of file, located anywhere, and then to use cut and paste to transfer chunks of test to Matlab to test them.

Matlab Help Desk

On-line Matlab manuals and other help information are available at the Mathworks site here. To use it, you'll have to "join", which you can do fairly painlessly, and then type your access code everytime.

A generally web-accessible version without a password is (at least now) available here.

Matlab introductions/tutorials

On the Matlab Help Desk page, the second of the "Matlab Topics" is called Getting Started. This links to a rather detailed tutorial, not all of which you probably want to assimilate at once. I suggest that you work through the beginning of it, and then look things up as needed.

Here are links to a postscript and a .pdf (Adobe Acrobat) version of a Matlab Primer by Kermit Sigmon. It deals with Matlab 4 (rather than the current version) but little or nothing has changed in the basic areas it deals with.

You may want to try some of the demos, especially the one called intro. Just start MATLAB (by typing matlab at the shell prompt), and then execute the command ``intro''.

Some helpful facts to get you going: