Difference between revisions of "Matlab"

From radwiki
Jump to navigation Jump to search
Line 6: Line 6:
  
 
An alternative way (untested) to generate the license file is to connect to a VNC session and run the MATLAB activation script.
 
An alternative way (untested) to generate the license file is to connect to a VNC session and run the MATLAB activation script.
 +
 +
After your license file is installed you can run MATLAB either in headless mode or with a GUI.
  
 
=== On the commandline (headless mode) ===
 
=== On the commandline (headless mode) ===
 
Just use `matlab` on the commandline to start the interactive console.  
 
Just use `matlab` on the commandline to start the interactive console.  
 
See [https://www.mathworks.com/help/matlab/ref/matlablinux.html the MATLAB documentation] for more options.
 
See [https://www.mathworks.com/help/matlab/ref/matlablinux.html the MATLAB documentation] for more options.
 +
 +
To run a script `myscript.m`, just type `myscript` in the session console, paths are relative to the `pwd`.
  
 
=== GUI version ===
 
=== GUI version ===
Line 15: Line 19:
  
 
# Example (Xserver):  
 
# Example (Xserver):  
#* Connect a PuTTy tunnel to cpu1 with X11 forwarding
+
#* Run xcsrv or xming on your Windows client.
#* run `matlab` on the commandline
+
#* Connect a PuTTy tunnel to cpu1 (by setting the checkbox "X11 forwarding" true).
#* then use Xming on your Windows client to view the MATLAB interface.
+
#* run `matlab` on the commandline, the MATLAB GUI interface will appear.
 
# Example (VNC):  
 
# Example (VNC):  
#* Connect a PuTTy tunnel with port forwarding your to your vncserver port
+
#* Connect a PuTTy tunnel to your vncserver port on cpu1
 
#* then use TightVNC viewer to view the remote desktop
 
#* then use TightVNC viewer to view the remote desktop
 
#* run MATLAB by typing `matlab` in a terminal or doubleclicking the link in your home folder.
 
#* run MATLAB by typing `matlab` in a terminal or doubleclicking the link in your home folder.

Revision as of 08:01, 28 May 2020

Guide to using MATLAB

MATLAB 2020a is currently available systemwide on cpu1, but users need to generate their license file first.

The main obstacle is that the HKU MATLAB licenses are on a per-user per-computer basis, so each user needs to provide an appropriate license file to be able to run the executable. This license.lic file can be generated from the Mathworks website after logging in with your HKU credentials, the name in the license must match your GPU cluster (linux) account ID. The host ID for cpu1 is E4434B84092F.

Click "Activate a Computer" to create your license file after logging into https://www.mathworks.com/licensecenter.

An alternative way (untested) to generate the license file is to connect to a VNC session and run the MATLAB activation script.

After your license file is installed you can run MATLAB either in headless mode or with a GUI.

On the commandline (headless mode)

Just use matlab on the commandline to start the interactive console. See the MATLAB documentation for more options.

To run a script myscript.m, just type myscript in the session console, paths are relative to the pwd.

GUI version

Run MATLAB in a VNC or X11 session. The GUI may look a little different compared to Windows.

  1. Example (Xserver):
    • Run xcsrv or xming on your Windows client.
    • Connect a PuTTy tunnel to cpu1 (by setting the checkbox "X11 forwarding" true).
    • run matlab on the commandline, the MATLAB GUI interface will appear.
  2. Example (VNC):
    • Connect a PuTTy tunnel to your vncserver port on cpu1
    • then use TightVNC viewer to view the remote desktop
    • run MATLAB by typing matlab in a terminal or doubleclicking the link in your home folder.

See also

HKU MATLAB for installation notes