How to Display a Matlab window from a remote computer

From COEHELP

Jump to: navigation, search

Contents

Using Matlab from your home PC or laptop

You can use your home computer or laptop to run Matlab in graphical mode remotely on a COE machine!

Matlab can also be run in text mode from the command line on any COE Unix/Linux machine if you don't need to display graphics.

If you need to display graphical results, here's how to run Matlab remotely. Be sure you are on a reliable broadband connection.

Windows

(1) You need to have two programs to be able to run Matlab remotely:

(2) First, you need to make sure that your ssh client allows X11 connections. To do this, you need to go to the configuration section (pressing the button that looks like two cogs usually works), select Tunneling and then check the "Tunnel X11 Connections" box.

(3) Start your X11 windows display manager (Xming, for example)

(4) Start your ssh client program (Putty, for example), connect to gateway.coe.neu.edu and login with your COE username and password.

(5) Type this command to connect to the Linux workstation "ergs.coe.neu.edu":

    ssh -Y -l <username> -p 27 ergs.coe.neu.edu

Use the same username and password as you used when you logged onto gateway.coe.neu.edu.

(6) You can now run Matlab. Type:

   matlab &

to start matlab and run it in the background. You should get a matlab window display after a few seconds.

Troubleshooting

  • If you don't get a display, type this command:
   echo $DISPLAY

If that command gives only a blank line as output, you have skipped one of the steps mentioned above. Be sure to allow X11 tunneling in your ssh client program (step (2) above). Also be sure to use the "-Y" switch (step (6)) when you ssh to workstation ergs.coe.neu.edu.

  • All Unix commands are CaSe-senSITive.

Mac

The software you need is already installed on your Mac.

(1) Start X11: go to the Applications folder, open the subfolder Utilities, and double-click on X11.app. It may not open a window; in the Dock, you should see an icon of a white square containing a black X.

(2) Open a terminal window: click on the X icon in the Dock to bring X11 to the foreground. At the top of the screen, you'll see X11 .. Applications .. Edit .. Window .. Help. Pull down the Applications menu and choose Terminal. This will open a small white terminal window with "xterm" in the title bar.

(3) Log in to the gateway. In your xterm window, type the line below, where <username> is your COE username. (The character after the hyphen is a lowercase L.)

    ssh -Y -l <username> gateway.coe.neu.edu

When prompted, type your COE password.

(4) Now log in to the Linux workstation "mu.coe.neu.edu" from the gateway. Type the following in your gateway terminal session:

    ssh -Y -l <username> -p 27 ergs.coe.neu.edu

(5) You can now run Matlab. Type:

     /COEnet/Linux/MATLAB/R2012a/bin/matlab &

to start matlab and run it in the background. You should get a matlab window display after a few seconds.

Troubleshooting

  • If you get an error message about X permissions when you try to start Matlab, try this: Open a second terminal window (see (2) above). In this second terminal, type
    xhost + ergs.coe.neu.edu  

Now type "/COEnet/Linux/MATLAB/R2012a/bin/matlab &" in your original terminal window to start Matlab again.

Linux

Personal tools