How can I use GETFRAME on a headless cluster in MATLAB (R2013a)?

1 view (last 30 days)
I have a large number of figures that I need to plot and capture using GETFRAME. Because the computations are time consuming, I have to send the job to a cluster. When I use GETFRAME, I get the following error message:
Error using getframe (line 53)
getframe requires a valid figure window.

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Oct 2013
To run MATLAB on a headless computer, you would use the following command:
matlab -noFigureWindow
You can then plot your figures and save them as follow:
surf(membrane)
print myFigure.eps
close
However, if you use the command GETFRAME, this latter causes the error
Error using getframe (line 53)
getframe requires a valid figure window.
because the graphics card did not render a figure that GETFRAME can take a screenshot of. Additionally, because workers perform jobs in the background and no display is exported, capturing a snapshot is not possible in the way GETFRAME is implemented.

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Products


Release

R2013a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!