MATLAB: How to set the dpi while using ‘imwrite’ to save a matrix into an image of ‘jpg’ format

dpi imwriteMATLAB

A is a matrix of 1000*1000*3
I want to export A as a 'jpg' image with dpi=240
imwrite(A,'filename.jpg');
the default dpi value is 96, how to change it into 240?

Best Answer

That is not one of the parameters that you can set with MATLAB's imwrite() function.