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?

Réponses (1)

x = 1:10; y = x;
h = plot(x, y);
% Save plot in png format using hgsave
hgsave(h, 'sample.png');

2 commentaires

Mr M.
Mr M. le 28 Juin 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 le 29 Juin 2015
Modifié(e) : Thorsten le 29 Juin 2015
Add before the plot:
try
figure
catch
% do nothing
end

Connectez-vous pour commenter.

Catégories

En savoir plus sur MATLAB Support Package for Raspberry Pi Hardware dans Centre d'aide et File Exchange

Question posée :

le 28 Juin 2015

Modifié(e) :

le 29 Juin 2015

Community Treasure Hunt

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

Start Hunting!

Translated by