Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| software:matlab:interactivetips [2019-08-29 14:29] – [Interactive Job tips for MATLAB] anita | software:matlab:interactivetips [2019-08-29 14:31] (current) – [Interactive Job tips for MATLAB] anita | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Interactive Job tips for MATLAB ====== | ||
| + | All MATLAB sessions should be run from the compute nodes. | ||
| + | |||
| + | |||
| + | * **'' | ||
| + | * **'' | ||
| + | * Logon to an available compute node by using the appropriate job scheduler command | ||
| + | * GridEngine **'' | ||
| + | * Slurm **'' | ||
| + | * **'' | ||
| + | |||
| + | Once you are successfully connected to a compute node, then you can start MATLAB in command line mode or run scripts. | ||
| + | ===== Command line Matlab ===== | ||
| + | <note tip> | ||
| + | To start in command line mode (no GUI) | ||
| + | <code bash> | ||
| + | matlab -nodesktop -nosplash | ||
| + | </ | ||
| + | You will still have access to the help browser (**doc** command), the editor (**edit** command), and graphics (**plot** command for example). | ||
| + | </ | ||
| + | |||
| + | ===== Command Line Matlab with no X11 display ===== | ||
| + | <note tip> | ||
| + | |||
| + | If you do not have an X11 server, or you do not need a display, start MATLAB with | ||
| + | <code bash> | ||
| + | matlab -nodisplay | ||
| + | </ | ||
| + | The **doc** command is not available, but you still can use the **help** command. | ||
| + | <code bash> | ||
| + | env EDITOR=vim matlab -nodisplay | ||
| + | </ | ||
| + | You can't display graphics, but you can export graphics to a file. | ||
| + | </ | ||
| + | |||
| + | ===== Execute a MATLAB script ===== | ||
| + | |||
| + | <note tip> | ||
| + | |||
| + | If your have MATLAB commands in a '' | ||
| + | <code bash> | ||
| + | matlab -nodisplay -r script | ||
| + | </ | ||
| + | All the text output from the script will appear on the terminal screen. | ||
| + | </ | ||
| + | |||
| + | ===== Execute a MATLAB script detached from the terminal ===== | ||
| + | <note tip> | ||
| + | If you have MATLAB commands in a '' | ||
| + | <code bash> | ||
| + | nohup matlab -nodisplay -r script & | ||
| + | </ | ||
| + | All the text output from the script will be appended to the file '' | ||
| + | |||
| + | You should not read from the terminal in your script. Without the **nuhup**, MATLAB may respond to any hangup signal from your terminal shell by stopping execution. Reading input from the terminal may cause your MATLAB job to stay loaded, waiting for input. | ||
| + | |||
| + | </ | ||