MATLAB Answers

change dpi from auto to 300 using matlab code?

78 ビュー (過去 30 日間)
Kaleesh Bala
Kaleesh Bala 2018 年 6 月 20 日
回答済み: Rik 2018 年 6 月 22 日
Is there any code to change the DPI from auto mode to 300 so that It can be added to the script directly,without manually going and changing in the picture settings?

  2 件のコメント

Sophia 2018 年 6 月 20 日
Here is an example-
res = 300;
print('figure1.tiff','-dtiff',['-k' num2str(res)]);
Kaleesh Bala
Kaleesh Bala 2018 年 6 月 22 日
Error using inputcheck Illegal option '-k300' given.

Sign in to comment.


Rik 2018 年 6 月 22 日
This code should work. I recognize the -k switch from a similar context, but the doc indicates that you should use -r. (I use sprintf so you can mistakenly enter a decimal res, Matlab will round it anyway during the writing of the image)
res = 300;
print('figure1.tiff','-dtiff',['-r' sprintf('%.0f',res)]);

  0 件のコメント

Sign in to comment.

その他の回答 (0 件)


Translated by