7

I am using my laptop to run MATLAB and it's very convenient but SLOW. We have strong servers that run MATLAB but it's more convenient for me to run the application with UI on my laptop (as opposed to say running Matlab through command line).

Is it possible to run matlab on Windows, locally, with UI, just that the code runs on a remote server (and thus quicker)?

Thanks!

2 Answers 2

7

Several options spring to mind, not all of which answer the precise question that you posed. Given that your laptop is Windows, you could do one of these things:

  1. Use remote desktop to connect to the server and run MATLAB there
  2. If the server is UNIX, you could run an X server on your laptop (there's a free one with cygwin)
  3. You could use the Parallel Computing Toolbox and MATLAB Distributed Computing Server to open a matlabpool on the server.

Options (1) and (2) basically mean you're transmitting the MATLAB UI over the wire to your laptop. Option (3) is sort-of most like what you originally asked for, but the matlabpool only runs the body of PARFOR and SPMD blocks on the server.

1

Launching MATLAB on a server without the GUI is covered thoroughly at http://blogs.mathworks.com/desktop/2010/02/22/launching-matlab-without-the-desktop/ you should also read the user comments/discussion there

e.g. you can use

start matlab -nosplash -nodesktop -nojvm -minimize -r "testcommand,quit"

if not using Java is too restrictive for your needs:

Regarding ‘-nodesktop’ vs. ‘-nojvm’, there is a third (undocumented/unsupported) option: ‘-noawt’. -noawt loads Java (thus enabling Java I/O, data structures etc.) and just prevents Java GUI

The discussion there also speaks of using the undocumented com.mathworks.mde.desk.MLDesktop.getInstance.getMainFrame.hide to hide the command-line window, but that command doesn't seem to work

BTW, instead of launching MATLAB via Windows shell command you could launch as a COM automation server:

http://www.mathworks.com/help/techdoc/matlab_external/brd0v3w.html

or via existing C API for launching MATLAB:

http://www.mathworks.com/help/techdoc/matlab_external/f29148.html

If you use this often (e.g. from a web service), it is best that you keep an instance of MATLAB in memory all the time (since Windows apps for example share code and have separate data this can spare much time by avoiding the reloading of MATLAB code into memory at every script run). That instance could be headless too (with no UI) using this command at server boot (e.g. by adding an entry at HKLM/Software/Microsoft/Windows/CurrentVersion/Run in the Windows registry using "regedit.exe"):

start matlab -nosplash -nodesktop -nojvm -minimize

2
  • 2
    this is useful, but it's not what the OP was asking for... Basically OP wanted a way to use laptop as thin client doing all the processing remotely on another machine
    – Amro
    Oct 1, 2011 at 1:25
  • one could make a service to run their .m files remotely (using the tips I posted above) and have a local MATLAB app with GUI talk to that remote service. Not sure if MATLAB provides such functionality out of the box (to offload processing to remote machine) via some toolbox (would be nice to have) Jun 6, 2013 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.