is it possible to plot and save figure in console mode?

using the plot function in -nodisplay mode is possible without error or warning? and the plot can be saved in .pgn format?

Respuestas (1)

Thorsten
Thorsten el 28 de Jun. de 2015
x = 1:10; y = x;
h = plot(x, y);
% Save plot in png format using hgsave
hgsave(h, 'sample.png');

2 comentarios

Mr M.
Mr M. el 28 de Jun. de 2015
thanks, but I want to display the plot in case of non-command mode. So it would be nice to work well in both cases.
Thorsten
Thorsten el 29 de Jun. de 2015
Editada: Thorsten el 29 de Jun. de 2015
Add before the plot:
try
figure
catch
% do nothing
end

Iniciar sesión para comentar.

Categorías

Más información sobre MATLAB Support Package for Raspberry Pi Hardware en Centro de ayuda y File Exchange.

Preguntada:

el 28 de Jun. de 2015

Editada:

el 29 de Jun. de 2015

Community Treasure Hunt

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

Start Hunting!

Translated by