Difference between revisions of "Matlab"
m (→GUI version) |
m (→GUI version) |
||
(6 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | == Guide to using MATLAB == | + | == Guide to using MATLAB on the HPC cluster == |
− | {{Note|MATLAB '''2020a''' is currently available systemwide on `cpu1`, but users need to generate their license file first.|warn}} | + | {{Note|MATLAB '''2020a''' is currently available systemwide on `cpu1`, but users need to generate their license file first. After your license file is installed you can run MATLAB either in headless mode or with a GUI. |warn}} |
− | 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. | + | 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 [https://www.mathworks.com/licensecenter 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. |
[[File:Matworks License Generator.png|thumb|Click "Activate a Computer" to create your license file after logging into https://www.mathworks.com/licensecenter. ]] | [[File:Matworks License Generator.png|thumb|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. | + | 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`, copy the file to your MATLAB path or current working directory, then 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 | + | #* 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). |
− | + | #* run `matlab` on the tunnel commandline, the MATLAB GUI interface will appear. | |
# Example (VNC): | # Example (VNC): | ||
− | * Connect a PuTTy tunnel | + | #* 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. |
=== See also === | === See also === | ||
[[HKU MATLAB]] for installation notes | [[HKU MATLAB]] for installation notes |
Latest revision as of 02:39, 2 June 2020
Contents
Guide to using MATLAB on the HPC cluster
cpu1
, but users need to generate their license file first. After your license file is installed you can run MATLAB either in headless mode or with a GUI. 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.
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
, copy the file to your MATLAB path or current working directory, then 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.
- 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 tunnel commandline, the MATLAB GUI interface will appear.
- 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