change dpi from auto to 300 using matlab code?

15 visualizaciones (últimos 30 días)
Ramesh Bala
Ramesh Bala el 20 de Jun. de 2018
Respondida: Rik el 22 de Jun. de 2018
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 comentarios
Sophia
Sophia el 20 de Jun. de 2018
Here is an example-
res = 300;
print('figure1.tiff','-dtiff',['-k' num2str(res)]);
Ramesh Bala
Ramesh Bala el 22 de Jun. de 2018
Error using inputcheck Illegal option '-k300' given.

Iniciar sesión para comentar.

Respuesta aceptada

Rik
Rik el 22 de Jun. de 2018
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)]);

Más respuestas (0)

Categorías

Más información sobre Logical en Help Center y File Exchange.

Etiquetas

Productos

Community Treasure Hunt

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

Start Hunting!

Translated by