San Diego State University

Technical Briefs

ROHAN help Files

----------------------------------------------------------------------

Matlab

The current release on ROHAN is Matlab & Simulink Release 13 a high performance software package for numerical computation and visualization. The name Matlab stands for MATrix LABoratory. The program lets users manipulate numerical data and create graphical representations of the information. Matlab also offers a complete programming environment that is easier to use and more powerful for numerical applications than traditional programming languages such as FORTRAN or C. SDSU has a 100 user floating license for Matlab Release 13 that includes Windows, Linux, and Solaris.

Starting | Help | Tutorials | Examples | Other Resources

The Matlab Compiler, mcc, allows deploying MATLAB applications to standalone C/C++ applications and users who want to compile their MATLAB algorithms to improve code performance by converting them to C. The MATLAB Compiler automatically converts M-files into C and C++ source code and contains optimizations that improve executable speed.

Matlab also has Simulink and many toolboxes available for use. Simulink is an interactive system for the nonlinear simulation of dynamic systems. It is a graphical, mouse-driven program that allows systems to be modeled by drawing a block diagram on the screen. It can handle linear, nonlinear, continuous-time, discrete-time, multivariable, and multirate systems. Matlab toolboxes are sets of Matlab programs designed to solve a specific set or type of problem. The following Matlab toolboxes available:

 
  • Communication Toolbox
  •  
  • Control Toolbox
  • Fixed Point Blocks
  • Fuzzy Logic
  • Identification Toolbox
  • Image Toolbox
  • Neural Network
  • Optimization Toolbox
  • PDE Toolbox
  • Simulink
  • Signal Toolbox
  • Statistics Toolbox
  • Symbolic ToolBox
  • Extended Symbolic
  • Top of document


    Starting Matlab

    1. Running Matlab with Xwindows

      Start Matlab by typing matlab at the UNIX prompt. To exit Matlab, type exit or quit. After Matlab begins the prompt will become ">>".

      Matlab will start up a graphics Xwindow on Unix systems, if your environment has DISPLAY defined. Normal Xlogins and ssh connections set DISPLAY automatically. If you can not use ssh or a direct Xlogin, you should define the DISPLAY variable or Matlab will only display text. See the X Windows page for more information.

      Simulink, the visual modeling environment, is started by typing simulink at the Matlab prompt.

    2. Running Matlab without Java

      Matlab's GUI is a bit sluggish with R13. I've found it much faster and more responsive to start Matlab without the GUI and Java by typing matlab -nojvm. Xwindows graphics will still be used for plots and helpdesk.

    3. Matlab M-Files and batch mode

      Matlab supports scripts and functions in external files (M-files). M-files must have the filename extension .m and can be executed like any other command at the Matlab prompt. Matlab also allows you to create functions using the function command and then call the functions in your commands. See Examples for links to various M-Files.

      Matlab can be run in batch mode with an input file (M-file), e.g. matlab_script.m, containing the commands which would have been executed in Matlab. Use this general syntax:

           matlab < matlab_script.m
      
      If you want to record output, either use the SAVE command inside your m-file or redirect the output of the MATLAB session to a file using this syntax:
           matlab < matlab_script.m > MyOutputFile
      
      This syntax only works for scripts. If you need to run a function, create a wrapper script that calls the function. The AT command can run the script at a specified time when the computer is less likely to be loaded down with other tasks:
         echo "matlab < matlab_script.m > output_file" | at hh:mm
      
      and the Matlab job will run at the specified time hh:mm, e.g. 01:00 for 1 am.

    4. Nice long runs

      Please reduce the priority of long running Matlab jobs by using the command nice +19 matlab (if bash is your login shell, use nice -19 matlab.) This greatly improves the response of the system while your job is run.

    Top of document


    Getting Help

    The Matlab Online Help can be accessed by typing help at the Matlab prompt, e.g. >> help. For general help, typing help will display a long list of available topics. If you know the name of the topic or function you are interested in. Example: for help on "General purpose commands", type help general.

    If you are running Xwindows, Matlab will startup a HELP window. This accesses The Matlab Manual, and has extensive documentation on Matlab, Simulink and tooboxes.

    The Matlab Manuals (hardcopy) are available for reference in Circulation/Reserves in Love Library.

    Top of document


    Tutorial Documents

    A Matlab Tutorial by the University of Utah.
    Getting Started With Matlab is a PDF tutorial on Matlab by David Hart.
    Matlab Basics Tutorial at the University of Michigan.
    Visit the Mathworks web site for more tutorial information.

    Top of document


    Matlab Examples

    The Matlab has a series of demonstration examples. Type demo at the Matlab prompt to browse available demos.

    Examples in the MATLAB Documentation lists a series of examples covering the desktop, mathematics, programming, and graphics.
    Matlab Central File Exchange contains hundreds of M-Files contributed by users and developers of MATLAB, Simulink and related products
    Matlab M-Files Database University of Stuttgart's collection of M-Files.

    Top of document


    Other Matlab Resources

    Matlab FAQ by the maker of Matlab.
    Matlab FAQ from the newsgroup comp.soft-sys.matlab.
    Matlab Newsgroup devoted to issues involving the use of Matlab.

    Top of document

    Download Adobe Acrobat Reader

    ----------------------------------------------------------------------


    BACK ROHAN Help Index | Academic Computing Handouts, Manuals, and Help Files