Error in saveas, can't save current figure
Afficher commentaires plus anciens
plot a heatmap and then tried to save the figure with saveas function on workspace,
according to the guide of matlab website "https://kr.mathworks.com/help/matlab/ref/saveas.html?lang=en"
the code is
>> saveas(gcf,'abc.png')
but, an error is occurred as follows,
Error : matlab.graphics.internal.name (line 101)* Cannot create output file '.\abc.png'*
error : print (line 71) pj = matlab.graphics.internal.name( pj );
error : saveas (line 181)
print( h, name, ['-d' dev{i}] )the contents of line101
error(message('MATLAB:print:CannotCreateOutputFile', pj.FileName));
Réponses (1)
madhan ravi
le 21 Oct 2018
Try the full code:
x = [2 4 7 2 4 5 2 5 1 4];
bar(x);
saveas(gcf,'abc.png')
Remark : Create figure before saving
1 commentaire
madhan ravi
le 21 Oct 2018
see attached .png file
Catégories
En savoir plus sur Printing and Saving dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!