Running MATLAB scripts on a remote server

I often have to run some experiments with large data sets in MATLAB. Therefore, it comes handy to do this on a machine that is different from my notebook. The following bash script remotely runs a given MATLAB script called matlabbg and writes all console output to some logfile:

nohup matlab -nodisplay -r "run $1" >$2 2>&1 &

To run the MATLAB script myscript.m in the background and write the output to myscript.log, simply do the following:

matlabbg myscript.m myscript.log

This entry was posted in MATLAB. Bookmark the permalink.

2 Responses to Running MATLAB scripts on a remote server

  1. George says:


    I have a matlab script that generates for image processing the Haralick features of an image. The problem is that I have the script in .m, I have the input images (2 images), but each image needs aprox. 2 days to be processed (2 days on my antique notebook). Can you help me with a server in which to run that script?

    Best regards,

    • Hi George,

      thanks for your comment. Unfortunately, I do not have access to a MATLAB server anymore. Therefore, I won’t be able to help you. Sorry.

      Best regards,

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.