Info

La pregunta está cerrada. Vuélvala a abrir para editarla o responderla.

Differences in filesize if matlab runs in background

1 visualización (últimos 30 días)
jan mischke
jan mischke el 5 de Nov. de 2015
Cerrada: jan mischke el 6 de Nov. de 2015
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?

Respuestas (0)

La pregunta está cerrada.

Community Treasure Hunt

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

Start Hunting!

Translated by