I have written a script called 'PrintFigureToTiff.m' that creates a figure and then saves it in TIFF format:
f = figure;set(f,'PaperUnits','centimeters','PaperSize',[15.5,11.5],'PaperPosition',[.0,.0,15.25,11.25]);h(1) = axes('Position',[0 0 1 1]);sphere;h(2) = axes('Position',[0 0 .4 .6]);sphere;h(3) = axes('Position',[0 .5 .5 .5]);sphere;h(4) = axes('Position',[.5 0 .4 .4]);sphere;h(5) = axes('Position',[.5 .5 .5 .3]);sphere;set(h,'Visible','off');print -dtiff -r200 image.tiff
I used the MATLAB Compiler 4.10 (R2009a) to build this script into a standalone application. When I run the standalone application on the target machine from the Unix shell console, the resolution of output image is 200*200 dpi as expected. However, when I run the executable as part of a cron job, the resolution of the output image becomes 72*72 dpi.
Why is the cron job saving to incorrect resolution?
Best Answer