Info

此问题已关闭。 请重新打开它进行编辑或回答。

Differences in filesize if matlab runs in background

1 次查看(过去 30 天)
I just recognized a strange behaviour of matlab. I got two script that create three .png files with print (script1 creates png1 and script2 creates png2 and png3). If I run them both manually in matlab the files that are created are 175KB, 4xxKB and 4xxKB big. If I use matlab in the background with
matlab -nodisplay -r "run('script1.m');run('script2.m');exit;
then my the filesize is changed. png1 is 281KB but png3 is over 1,4mb big...Where could this come from? Both scripts use exactly the same print command:
fig = gcf;
fig.PaperUnits = 'inches';
fig.PaperPosition = [0 0 15 9];
fig.PaperPositionMode = 'manual';
fname = ['Energy_resolved',num2str(k)];
set(gcf,'Visible','off');
print(['-f',],'-dpng','-r0','r300',fname);
close(gcf);
The only difference is that in the second script I use a for loop to create two pictures instead of one picture in the first script, but still that does not describe the difference between calling the script manually in matlab and in the command line in the background, or does it?
EDIT: I just recognized that even the pictures look different if I plot them IN matlab or with matlab in the background. If I run it in the background my curves are not curvy but edgy (and the file size almost doubles or even tripples). So what do I miss here?

回答(0 个)

此问题已关闭。

Community Treasure Hunt

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

Start Hunting!

Translated by