MATLAB Answers


MATLAB with OpenGL through terminal?

Asked by Aaron Anderson on 13 Jul 2017
Latest activity Commented on by Aaron Anderson on 20 Jul 2017
I'm curious if it's possible to get MATLAB running with any form of OpenGL from the terminal. The issue is I am currently running MATLAB through a ssh client and incapable of running the normal desktop mode. I received a warning when creating some figures that OpenGL is not available when running through the terminal and there were lines running all over the figure's graphics objects.


Sign in to comment.

1 Answer

Answer by Nagarjuna Manchineni on 17 Jul 2017

When you are running MATLAB from the command line (any SSH client), you can use 'nodesktop' mode to run MATLAB command line mode. Use the following command to run MATLAB from terminal:
>> matlab -nodesktop -nosplash
There is no need to alter 'opengl' behavior until you are trying to launch some figures. You can disable launching figure windows by specifying the '' startup option. For example,
>> matlab -nodesktop -nosplash -noFigureWindows
Also, if you want to alter opengl behavior or want to execute any script while launching MATLAB, you can use the '-r' flag and execute the script. For example,
>> matlab -r "opengl software"
Refer to the following documentation link for more startup options:

  1 Comment

A couple of issues that I run into:
matlab -r "opengl software"
doesn't appear to work, as when I then type openGL info, it is missing the mesa software tag
Version: ''
Vendor: ''
Renderer: 'None'
RendererDriverVersion: ''
RendererDriverReleaseDate: ''
MaxTextureSize: 0
Visual: ''
Software: 1
HardwareSupportLevel: 'none'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 0
SupportsAlignVertexCenters: 0
Extensions: {}
MaxFrameBufferSize: 0
opengl hardware doesn't work because it is apparently not supported at runtime on unix.
What I want to do is to make figures and use export_fig to create some PDFS. The issue is that without openGL I cannot properly render the images so they come out with lines running all over them.

Sign in to comment.