Info

この質問は閉じられています。 編集または回答するには再度開いてください。

Differences in filesize if matlab runs in background

1 回表示 (過去 30 日間)
jan mischke
jan mischke 2015 年 11 月 5 日
閉鎖済み: jan mischke 2015 年 11 月 6 日
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