• Skip to Main Content
  • Go to the Website's Home
  • Go to Website News
  • Go to About this site
  • Skip to Audience Navigation Menu
  • About
    • Welcome to the College
    • Facts and Figures
    • Message from the Dean
    • Visit Us
    • College Administration
    • News Center
  • Research
    • Research Home
    • Departments
    • Centers & Labs
    • Faculty Directory
    • Opportunities for Undergraduates
  • Admissions
    • Undergraduate Admissions
    • Undergraduate Recruiting
    • Graduate Admissions
  • Academics
    • Departments
    • Undergraduate Programs and Degrees
    • Graduate Programs and Degrees
    • Course Guide/Bulletin
    • Teaching
    • Support Services
  • Departments
    • Aerospace Engineering
    • Atmospheric, Oceanic and Space Sciences
    • Biomedical Engineering
    • Chemical Engineering
    • Civil and Environmental Engineering
    • Electrical Engineering and Computer Science
    • Industrial and Operations Engineering
    • Interdisciplinary Professional Programs
    • Materials Science and Engineering
    • Mechanical Engineering
    • Naval Architecture and Marine Engineering
    • Nuclear Engineering and Radiological Sciences
  • Support the College
    • Giving
    • Involve Yourself
    • Corporate Relationships
  •   

College of Engineering

Center for Advanced Computing

  • Welcome
  • About
  • Getting Started
    • Getting Started
    • Learning About HPC
    • CAC Training Courses
  • Resources
    • Resources
    • Systems
    • Software
    • Storage
    • Networking
    • Visualization
    • Teragrid
  • Academics
  • Contact Us
  • Frequently Asked Questions
Follow Us On Twitter

Contact Information

[Contact] Center for Advanced Computing
College of Engineering
cac-support@umich.edu Link

Center for Advanced Computing  /  Resources  /  Software  /  Matlab

Matlab

IMPORTANT:The following instructions are only for people who are not able to use the Matlab Compiler, mcc. Using mcc preservesmatlab licenses and allows you to run many more copies of your Matlab code. Please makeevery effort to use mcc. If we see you using Matlab, we may ask you aboutyour experiences with mcc, so if you have trouble, please let us know.

Matlab in Serial

To access Matlab on the clusters, you must first type module load matlab.

A sample PBS script that shows a 1-CPU Matlab job looks like this:

#PBS -N matlab1
#PBS -q route
#PBS -l nodes=1,mem=1gb,walltime=24:00:00
#PBS -l gres=matlab
#PBS -M your-email-address
#PBS -m abe
#PBS -V
#
echo "I ran on:"
cat $PBS_NODEFILE
#
#cd to your execution directory first
cd /home/your-user-name/your-matlab-directory
#Run the input file.m
matlab -r file
#

Plotting in Batch Sample

y=1:100;
plot(y,y)
print -depsc yvsy
  %save the plot as yvsy.eps (postscript color)
  %run: 'help print' for options (-djpeg -dpng etc)
exit
  %matlab must exit in all batch jobs when finished

Notethat your Matlab job will not have any access to a graphical display orterminal, so all of your input must be handled by one .m file (which can call other .m files) and all of your output must be written to either a file or the screen (standard out) by Matlab or saved with the printcommand. It is slightly faster to write your output to the screen(standard out) and let PBS deliver the results to you at the end. Ifyou send your output to the screen, you can monitor it while it isrunning using the qpeek command; type qpeek --help for more information.

To use the Symbolics Toolkit you need to use the 32-bit version of matlab; start your session with the option -glnx86.

Matlab in parallel using the Distributed Computing Toolkit

Please see our dedicated page: Matlab DCT

CSS 2.1 Valid
University of Michigan
  • Home
  • Contact Us
  • Site Map
  • Site Feedback
  • Accessibility
  • Emergency Procedures
  • Jump to top of the page
© 2009 College of Engineering, University of Michigan