change dpi from auto to 300 using matlab code?

조회 수: 13 (최근 30일)
Ramesh Bala
Ramesh 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
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