MATLAB installations at NSC

Directory list:

R2011a Matlab [Link]
R2012a Matlab [Link]
R2012b Matlab [Link]
R2013a Matlab [Link]
R2014a Matlab [Link]
R2014b Matlab [Link]
R2015a Matlab [Link]
R2015b Matlab [Link]

Level of support

Tier 3 NSC will not be able to help you much with this program, either because we lack the in-house experience, or because it is a test installation. In general, these types of installations are untested, and will not be updated unless you send a request to NSC.

Please see the page describing our software support categories for more information.
You can also contact for further information.


The following Matlab licenses are available at NSC. If you are covered by one of them, please contact and ask to be added to the appropriate license group.

  • Linköping University Matlab TAH license. Available to all Linköping university staff and students.
  • Chalmers University Matlab license.
  • KTH Matlab license.
  • SU Matlab TAH license.
  • Uppsala University Matlab license.
  • Lund University Matlab license.
  • SMHI Matlab license.

If you work at an organization that does not have its license listed above, please contact and we will help you find out if you can use Matlab at NSC using that license.

How to run

Load the Matlab module corresponding to the version you want to use.

module load matlab/R2012a

To run Matlab interactively, allocate a compute node for interactive use and then run matlab:

interactive -N1 --exclusive -t 00:30:00

When running the GUI, NSC recommends using ThinLinc to access Triolith. For more information on how to use ThinLinc, please see the page Running graphical applications.

To run Matlab with ThinLinc and hardware accelerated OpenGL support:

vglrun matlab

If you do not want the graphical Matlab desktop, you can run in text-mode:

matlab -nodesktop

Please do not run Matlab on the login node!

Running Matlab batch jobs

Assume that you have a Matlab function saved in the file “parallel.m” that you want to run many times with different input (in this example we will use the inputs 1, 2, 3, … 32).

function S = parallel(x)
% Sum average of N random numbers
format long
s = RandStream.create('mt19937ar','seed',x);
N = 1e7;
R = rand(s, N, 1);
S = sum(R)/N;
filename = ['parallel_', num2str(x), '.out'];
fprintf(fid,'A small Matlab example\n');
fprintf(fid,'Run with the input: %s\n', num2str(x));
fprintf(fid,'Sum average = %16.12f\n',S);
% End

You could then use this batch script (saved as

# Load the Matlab module
module load matlab/R2012a

# Use 2 nodes, i.e. 32 cores, for 10 minutes
#SBATCH -N 2 --exclusive
#SBATCH -t 00:10:00

MATLAB='matlab -nodesktop -nodisplay -singleCompThread'
# The name of the Matlab script (without .m)

# Note the explicit "exit" to exit Matlab.
for i in $(seq 1 32);do
  srun -N1 -n1 --exclusive ${MATLAB} -r "${job}(${i});exit" > ${job}_${i}.log &
wait # needed to prevent the script from exiting before all Matlab tasks are done

# End of script

To run this batch job, submit it using:


Please see the Batch jobs and scheduling page for more information on how to submit and check the result of your batch jobs.