Matlab Access

Although it is a useful environment for exploring and prototyping numerical methods, Matlab is unfortunately not free. On this page we show a number of approaches for accessing Matlab to do your computational work in this course.

Separate sections discuss available options:

Local installation (using SMU license)

SMU has a site license for Matlab that allows faculty, staff and students to install Matlab on a personal computer. Information on the installation process, as well as relevant download links, are avaialble at www.smu.edu/OIT/Services/Info/Matlab.

Cloud-based installation

SMU hosts a cloud-based version of Matlab at apps.smu.edu. I have confirmed that this works in Windows, OS X and even Linux (though your results may vary in Linux). Be careful about saving files to/from the virtual machine, since you will need to turn in your Matlab “diary” files.

Before following any of the instructions below, download Citrix Receiver and install it on your computer as usual.

Note

Accessing files in Matlab from the cloud (Windows)

The following instructions describe how to store files (e.g. your diary files) on your computer from Matlab running on apps.smu.edu. These were put together from a Windows client; I do not know whether these will work for other operating systems.

In these instructions, replace username with your user name on your computer, and lastname with your surname.

  1. Open Matlab using apps.smu.edu

  2. If a warning pops up about Citrix Reciever accessing files on your computer, select Allow

  3. Locate where you want your Matlab files to be saved on your computer. For instance, you could create a folder called MATLAB in My Documents or Documents or on your Desktop. If you created a Documents folder in your home directory, this will give you a Windows file path like

    C:\Users\username\Documents\MATLAB

  4. At the Matlab command prompt, change Matlab’s current working directory to this folder with the command:

    >> cd '\\Client\C$\Users\username\Documents\MATLAB'
    
  5. The Matlab commands

    >> diary 'lastname_hw1.txt'
    

    and then once you’ve finished your work,

    >> diary off
    

    will create a file called lastname_hw1.txt on your computer in Matlab’s current working directory.

  6. (advanced) If you create a new function or script in the Matlab editor (after you have performed Step 4), Save As will automatically save the new function/script in Matlab’s current working directory.

Note

Accessing files in Matlab from the cloud (OS X)

Accessing your computer’s files from Matlab in OS X is similar to the Windows instructions above. As above, replace username with your user name on your computer, and lastname with your surname.

  1. Open Matlab using apps.smu.edu

  2. In the Matlab desktop, click on the Open Folder icon (the yellow one shown here):

    _images/open_folder.png
  3. Navigate to the folder where you want to save/access your Matlab files. Your home directory is likely located at the left under Local Disk (H: on xxx), as seen below

    _images/local_disk.png
  4. The Matlab commands

    >> diary 'lastname_hw1.txt'
    

    and then once you’ve finished your work,

    >> diary off
    

    will create a file called lastname_hw1.txt on your computer in Matlab’s current working directory.

  5. (advanced) If you create a new function or script in the Matlab editor (after you have performed Step 3), Save As will automatically save the new function/script in Matlab’s current working directory.

Note

Linux and apps.smu.edu

The following setup instructions worked for me to use apps.smu.edu with the Firefox browser, on modern Ubuntu and Mint systems. I have never successfully used apps.smu.edu from Chrome, and these instructions may not work on other Linux variants.

One-time setup:

  1. Download and install the newest version of Citrix Receiver (and the associated USB Support Package) that is available for your Linux distribution (requires superuser privileges; install Receiver before the USB support): www.citrix.com/downloads/citrix-receiver/linux.html

  2. At the terminal, allow Firefox and Citrix Receiver to share SSL certificates with the command (again, requires superuser privileges):

    $ sudo ln -s /usr/share/ca-certificates/mozilla/* /opt/Citrix/ICAClient/keystore/cacerts
    
  1. At the terminal, you can launch the graphical Citrix configuriation manager with the command:

    $ /opt/Citrix/ICAClient/util/configmgr &
    

    Under “File Access” I suggest that you “Add” a mapped drive for your Linux home directory so that you may follow instructions similar to the Windows instructions above for interacting with your local filesystem. For example, I mapped my home folder to drive “A”, and can access it at the Matlab prompt with the command

    >> cd \\Client\A$
    

    You can now do the same operations to create/save a diary as in the Windows and OS X instructions above.

You should then be able to use Firefox with apps.smu.edu to launch cloud-based applications. When launching an application, you may need to tell Firefox to open the .ica file with “Citrix Receiver Engine”.

Additional discussion/instructions for Ubuntu/Mint users may be found here.

Campus computer labs with Matlab

Matlab is accessible in nearly every public computer lab on campus, although some of these labs are available only for classroom use, or require a separate Lyle computer account to log in. The following list was last updated in Spring 2015 – if you notice any missing labs, or labs that no longer have Matlab, please let me know:

  • Fondren Library West 103b (general SMU login)
  • Fondren Library West 103c (general SMU login)
  • Fondren 124 (general SMU login)
  • Heroy 126 (general SMU login)
  • LEC (general SMU login)
  • Umphrey Lee 301 (general SMU login)
  • Clements G15 (general SMU login, classroom use)
  • Junkins 102 (Lyle login, classroom use only)
  • Junkins 342 (Lyle login)
  • Junkins 344 (Lyle login)
  • Embrey 124 (Lyle login)
  • Caruth 116 (Lyle login)

Purchase a student version of Matlab

You may purchase and download a personal copy of Matlab at this site. When I last checked, it cost around $49 or $99 for the student versions, and is available for Windows, Mac, and Linux computers. If you do this, you do not need to purchase any of the additional Matlab toolboxes for this course (all are available for an additional fee), so be careful not to check any extra boxes. Since you can already download/install Matlab for free on a personal computer, I only advise this for students who are about to graduate and think you might need it in the future (it costs much more if you’re not a student).

Octave – a free Matlab clone

For more cost-conscious students, you may download/install Octave, which is a free program that provides nearly identical functionality to Matlab (or at least a large subset). There are versions available for the Windows, Mac, Linux, Solaris, and even OS/2 operating systems, as well as source code that may be compiled on other platforms.

While Octave is nearly identical to Matlab for our programming needs in this course, Octave’s graphics are less user-friendly than those in Matlab, so you may wish to perform graphical portions of problems in Matlab.

Run Matlab remotely from a Linux server

For those of you with computer accounts on the engineering linux servers (full list here), it is also possible to run Matlab remotely.

Mac OS X (and Linux) Instructions:

  1. OS X only: Ensure that you have XQuartz (previously X11) running. If you have not already installed XQuartz on your Mac, it is available for free through the App store, or for older versions of OS X it can be found on the installation DVD that came with your computer.

  2. Open a Terminal:

    1. OS X: Applications -> Utilities -> Terminal.app
    2. Linux: the method for opening a terminal will depend on which window manager you use, though if you’re using Linux you probably already know how to open a terminal.
  3. SSH into the Linux server, e.g.

    $ ssh dan@genuse31.lyle.smu.edu -CX
    

    Replace “dan” with your username on that machine. Be sure to include the -CX (or equivalently, -CY), otherwise the Matlab desktop will not appear, and instead you’ll end up running Matlab in the terminal window and be unable to open plots.

  4. Run matlab at the command prompt:

    $ matlab &
    

    The ampersand at the end runs Matlab in the background, so that you can continue to use the terminal window for other things. If you forget the ampersand, function will return to the terminal once you close Matlab.

For more information on interacting with Linux and Unix servers from an OS X computer (including how to transfer files), see this page of OS X instructions.

Windows Instructions:

A full description on how to interact with Linux servers from a Windows computer, including links for freely-downloadable software and instructions on how to transfer files, is provided on this page of Windows instructions.