MATLAB: What is the purpose of the ResolutionUnit property of the TIFF object in MATLAB 7.10 (R2010a)

MATLAB

I would like to specify the XResolution and YResolution for my TIFF image as pixels per inch. However when I set the XResolution and YResolution tags, those settings do not scale the image as I expect.

Best Answer

This change has been incorporated into the documentation in Release 2011a (R2011a). For previous releases, read below for any additional information:
In order for the XResolution and YResolution settings to be effective, you also need to specify a value for the ResolutionUnit tag.
For example:
t= tiff('myimage.tiff', 'w');
tags.ResolutionUnit = Tiff.ResolutionUnit.Inch;
tags.XResolution = 300; % 300 dpi in the X direction
tags.YResolution = 300; % 300 dpi in the Y direction
t.setTag(tags);
Other valid values for the 'ResolutionUnit' property are:
Tiff.ResolutionUnit.None % image ignores XResolution and YResolution tags
Tiff.ResolutionUnit.Centimeter % resolution in dots per cm