From within a Java program, how do I make a MATLAB call (via a function built with Compiler SDK) that is headless, so that an invisible figure can be saved as a jpg without MATLAB crashing?

조회 수: 7 (최근 30일)
My main program is Java and this makes calls to MATLAB via the Compiler SDK. This mechanism works fine. One particular MATLAB function creates an invisible plot and saves a jpg using saveas - I create the new plot with figure('visible', 'off'). When I run in my development environment, this works very well. However, when I deploy to a field processor running Ubuntu server and MATLAB MCR R2015A, MATLAB crashes with a segmentation violation (which appears to be graphics related).
I know MATLAB can be called with command line arguments to make it headless. How can this be done when function calls to MATLAB are made from within Java?
  댓글 수: 1
Peter
Peter 2015년 9월 21일
I have found the solution. Ubuntu Server requires three extra libraries to allow MATLAB to plot graphs without crashing. I needed to install libgl-mesa-glx, libglu1-mesa and libxrandr2. Invisible plots can now be created and saved without MATLAB crashing.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Introduction to Installation and Licensing에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by