Matlab hangs up when using the "print" command to export figures

10 次查看(过去 30 天)
Hi,
Matlab hangs up when using the "print" command to export figures. I can not interrupt the software and I have to kill the process.
My script makes simple 3d graphics and uses some additional functions written by me. What is weird is that the problem is systematic, however, the same functions, used to generate ather plots, do not causes any problem. The problem arises with the print command, no matter the option used. Matlab goes in "Busy" state but it allows me to, e.g., edit the script.
I tried to add before/after the print command the pause and/or drawnow commands but without success as suggested here (<http://undocumentedmatlab.com/blog/s...b-hang-problem)>.
uname -a
Linux laresa 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
ver
----------------------------------------------------------------------------------------------------
MATLAB Version: 8.3.0.532 (R2014a)
MATLAB License Number: ••••••
Operating System: Linux 4.4.0-57-generic #78-Ubuntu SMP Fri Dec 9 23:50:32 UTC 2016 x86_64
Java Version: Java 1.7.0_11-b21 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
----------------------------------------------------------------------------------------------------
Any help is welcome g.

回答(3 个)

Jonathan
Jonathan 2017-1-11
I have the same problem, using Matlab2016b on an iMac (OS 10.12.2). It happens for high-resolution images but not lower resolution images. Is there a way to test for when an image is too large to print without causing Matlab to hang?
It does not appear to be a RAM issue. Matlab is using 1.2 GB and there is plenty of RAM free.
  1 个评论
g. a.
g. a. 2017-1-11
not related to resolution in my case. i tried with options -r100 and -r10 (default is -r150) and get stacked as well. g.

请先登录,再进行评论。


rachael
rachael 2017-8-31
I’m running into the same problem when remote connecting to a Linux machine.
Did you ever figure out the problem or a work around? The command I’m using is:
print(-dpng,-r300,[figure text plusnum2str(a number)]);

pablo salinas
pablo salinas 2018-2-22
set(gcf,'renderer','zbuffer');
print('-dpng','-r80','out.png');

类别

Help CenterFile Exchange 中查找有关 Interactive Control and Callbacks 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by