Error in saveas, can't save current figure
Ältere Kommentare anzeigen
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));
Antworten (1)
madhan ravi
am 21 Okt. 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 Kommentar
madhan ravi
am 21 Okt. 2018
see attached .png file
Kategorien
Mehr zu Printing and Saving finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!