User Tools

Site Tools


cluster:matlab

Table of Contents

Matlab

The cluster has Matlab R2017a (located at /usr/local/MATLAB/R2017a/bin) and R2018a (located at /usr/local/MATLAB/R2018a/bin). To run Matlab, use the command:

matlab -nojvm -nodisplay

Using just the below command will also work, though it will give errors from failing to find a display:

matlab

To run Matlab in batch mode, use the command

matlab < your-file.m

This command will print the results of your-file.m onto the screen. If you want to redirect this to an output file, use

matlab < your-file.m > log.txt

Graphics

You should bear in mind that the cluster excels at numerical analysis and NOT graphics. By default, there is only a command line interface to Matlab. It is possible to get graphics from the server forwarded to your computer, but it is VERY slow.

If you want to create graphs, this is still possible. By assigning your plot command to a variable and then using saveas, you can get this effect:

h = plot(x,y)
saveas(h,'yourFigure.jpg')

Tomlab

The department has a license for Tomlab, which contains several optimization algorithms that improve on Matlab's defaults. If you are solving problems that are computationally difficult you might try solving using Tomlab instead.

Dynare

Dynare is able to handle large class of dynamic economic models, especially good for solving DSGE and OLG models. Dynare is currently available on the cluster as a toolbox. You will need to modify the access path by including the following line to your code:

addpath /usr/local/matlab/toolbox/dynare

For more information on how to use Dynare visit the Dynare Website.

Parallel

The cluster also has Matlab Parallel Computing Toolbox.

cluster/matlab.txt · Last modified: 2021/02/02 16:16 by mcloughlin