Show pageOld revisionsBack to top This page is read only. You can view the source, but not change it. Ask your administrator if you think this is wrong. ====== Interactive MATLAB tips ====== Starting MATLAB in command line mode or running scripts on a Compute node. All MATLAB sessions should be run from the compute nodes. - **''cd''** -- change to your Matlab directory. - **''workgroup''** -- activate your workgroup. - **''qlogin''** -- logon an available compute node. - **''vpkg_require''** -- Add Matlab and dependencies to your environment. **Details by clusters** * [[software:matlab:Mills]] * [[software:matlab:Farber]] ===== Command line Matlab ===== <note tip> To start in command line mode (no GUI) <code bash> matlab -nodesktop -nosplash </code> You will still have access to the help browser (**doc** command), the editor (**edit** command), and graphics (**plot** command for example). </note> ===== Command Line Matlab with no X11 display ===== <note tip>**Command Line Matlab with no X11 display** If you do not have an X11 server, or you do not need a display, start MATLAB with <code bash> matlab -nodisplay </code> The **doc** command is not available, but you still can use the **help** command. You can use the **edit** command, provided you had exported the EDITOR environment variable, For example, to use **vim** as your editor: <code bash> env EDITOR=vim matlab -nodisplay </code> You can't display graphics, but you can export graphics to a file. </note> ===== Execute a MATLAB script ===== <note tip>**Execute a MATLAB script** If your have MATLAB commands in a ''script.m'' file, then start with the command <code bash> matlab -nodisplay -r script </code> All the text output from the script will appear on the terminal screen. If this last command in the ''script.m'' file is **quit** or **exit** you will be returned the bash prompt. </note> ===== Execute a MATLAB script detached from the terminal ===== <note tip> If you have MATLAB commands in a ''script.m'' file, start with the command <code bash> nohup matlab -nodisplay -r script & </code> All the text output from the script will be appended to the file ''nohup.out''. You will be returned immediately to the bash prompt while the script runs in the background. If you exit or logout the interactive terminal session the MATLAB job will continue to execute, writing output to ''nohup.out'' and exporting graphics to files. 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. </note> ===== Cluster details ===== **Using MATLAB details by cluster** * [[software:matlab:Mills]] * [[software:matlab:Farber]] software/matlab/interactive.txt Last modified: 2017-10-23 21:22by sraskar