Using MATLAB®
To run MATLAB® from a WINDOWS PC
MATLAB® may be started from a shortcut or from the WINDOWS Start button. This will bring up the MATLAB® command/desktop window with the MATLAB® prompt >>.
You can specify the path name that MATLAB® uses to search for program or data files in the current directory text box near the top of the command window. You can also save a set of path names that are routinely searched by selecting the Set Path... and then Add Folder ... from the File pulldown menu.
Entering MATLAB® commands
Interactive mode — Run individual MATLAB® commands directly from the command window.
Batch mode — Run a series of commands (a program) all at once. These commands are stored in a text file identified with a .m suffix.
To create or modify program files for batch mode use the MATLAB® editor. To start the MATLAB® editor window from the main MATLAB® window select New and then M-file from the File pulldown menu in the desktop window or enter the command edit from the command line. To edit an existing file select open and select the approriate file or enter edit followed by the file name.
A batch mode MATLAB® program can take the form of a script or a function:
A script runs much as if you were typing the program statements in the command window. In particular, the values of all variables are retained in memory and are accessible even after the program has run.
A function is similar, except that only designated variables are available outside the function.
You can run a script or function by typing the name of its file (without the .m suffix) in the MATLAB® command window. For example, if your program is stored in the file myprogram.m then you run it by entering:
>> myprogram
Depending on the display options you chose the results of the computations will be shown in the main MATLAB® window, plotted in a separate plot window, or written to another file.
MATLAB® Resources
The MATLAB® resources available to you both on-line and as hard copy are plentiful and easily accessible. The following links represent a brief summary of available MATLAB® documentation to get you started.
Help within MATLAB®
Typing helpdesk at the MATLAB® prompt will bring up the MATLAB® Helpdesk . This is a web page based version of the MATLAB® documentation/manuals.
Typing help [command] at the MATLAB® prompt will give you a brief explanation of [command].
If you DON'T know what command you are confused about, typing help at the MATLAB® prompt will give you a list of categories. Then typing help [category] will produce a list of commands in [category]. For example, one of the categories is graphics. Typing help graphics produces a list of the MATLAB® graphics commands.
MATLAB® on Athena: A web-document covering basic MATLAB® usage from Athena On-Line Help.
MATLAB® Stock Answers: FAQs from Athena On-Line Consulting.
Inessential MATLAB®: SIPB document of basic MATLAB® usage.
MATLAB® at MIT Homepage: Information about MATLAB® from the Athena people. Contains a lot of logistical information as well as many useful links.
Mathworks Homepage: The makers of MATLAB®. Information on acquiring Mathworks products plus links to documentation, etc.
Mathworks Support: This is a useful site that has technical information, web version of Helpdesk, and a downloadable user-library of scripts. Everything you ever dreamed of knowing about MATLAB®, plus you can always email Mathworks.
Athena Minicourses: Offered throughout the semester by the Athena Training Group. Basically a one hour short-course to get you started.
Useful Links
Rice Virtual Lab in Statistics — This is an excellent site that includes a virtual textbook, many useful links, and some animated demos. Compiled by a psychology professor who teaches statistics.
Ecology through time — Science magazine site includes numerous links to sites with data from long-term ecological monitoring studies.
NWIS water data — USGS site with surface and ground water data for US.
MATLAB® is a trademark of The MathWorks, Inc.