change dpi from auto to 300 using matlab code?

14 次查看(过去 30 天)
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
Sophia 2018-6-20
Here is an example-
res = 300;
print('figure1.tiff','-dtiff',['-k' num2str(res)]);
Ramesh Bala
Ramesh Bala 2018-6-22
Error using inputcheck Illegal option '-k300' given.

请先登录,再进行评论。

采纳的回答

Rik
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)
figure(1),clf(1)
plot(randi(10,1,10))
res = 300;
print('figure1.tiff','-dtiff',['-r' sprintf('%.0f',res)]);

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Logical 的更多信息

产品

Community Treasure Hunt

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

Start Hunting!

Translated by