Research Computing >> Software >> Matlab
UNIX: Matlab (R2011b) is currently available
in Kellogg's UNIX server, Skew5. To start
Matlab, type "
Research faculty and staff can also get a copy of NU licensed MATLAB for UNIX on their LINUX/UNIX workstations, provided the machines are university owned. The license fees need to be paid through a CUFS account. Please contact Research Computing for more information.
MS Windows: Matlab version is installed in 16 machines at the Kellogg computer laboratories. Through a Northwestern University campus-wide site license, faculty can use this license on their desktop or laptop machines by paying a license fee. Kellogg departments or faculty members can also request copies for doctoral students. The license fees need to be paid through a CUFS account. Research Computing administers Matlab licenses for Kellogg.
To install the current version of Matlab please go to the following link:
The following toolboxes are available:
Matlab is an interactive, matrix-based language for technical computing, which allows easy implementation of statistical algorithms and numerical simulations. Highlights of Matlab include the number of toolboxes (collections of programs to address specific sets of problems) available. The disadvantage of Matlab is that it tends to use a significant amount of memory and it is relatively slow in executing if-statements, and for- and while-loops that can not be vectorized.
The MathWorks web pages offer several support options:
To start Matlab in UNIX (either in a terminal or in a X-Windows session), type "matlab" at the prompt. To run a Matlab m-file in "batch", use the UNIX re-direction symbol ("<"). For example:
Matlab reads each line of filename.m as if it was typed by the user at the Matlab prompt.
To end the Matlab session, type " quit " at the Matlab prompt (">>"). If you do not exit the program properly (i.e., if you quit by closing the Xterm or telnet session, rather than typing "quit"), the Matlab session does not end. It continues to use memory and CPU.
When running time-consuming M-files, it may be desirable to run Matlab in the background in order to work on something else or to log out of the computer. To run Matlab in the background, type the following command at the UNIX prompt.
where "file.m" is the M-file to be executed, and "output" is the file to which the output will be sent. Note the output file contains everything that would be printed on the screen if you run your job in interactive mode. In most cases, it only contains debugging messages and does NOT contain the results of your program. You need to include save command in your program to save the results to a physical file. If you are not interested in saving the output, you may specify /dev/null in the place of output.
The following example shows what it looks like:
Matlab under Windows runs and ends as any other Windows application. The "quit" command from the Matlab prompt will work, too.
User contributed M-files:
Improving the performance of a program: There are several tools and options to improve a program's performance.
See also the Matlab page at the University of Cambridge for more tips on optimizing your code.
MEX-files: Bottleneck computations (usually for and while loops) can be recoded in C or Fortran for run much faster than in Matlab. MEX-files also allow Matlab to access existing C or Fotran routines without rewriting them. For reference, see:
Numerical Computing with Matlab by Cleve Moler (Mathwork's Chief Scientist and founder), 2004.
Note: A complete set of Matlab reference documentation (including manuals for each toolbox, and printable PDF files) is available online:
In addition, computers where Matlab is installed also have the documentation:
|© 2001-2010 Kellogg School of Management, Northwestern University|