Saveas error-Cannot create output file
Ältere Kommentare anzeigen
Hello,
i write this very simple code in MATLAB R2020b:
clear
clc
close all
x=[1 2 3 4 5];
y=x;
plot(x,y)
saveas(gcf,'Image.jpg');
But i obtain this error:
Error using matlab.graphics.internal.name (line 101)
Cannot create output file '.\Image.jpg'.
Error in print (line 71)
pj = matlab.graphics.internal.name( pj );
Error in saveas (line 181)
print( h, name, ['-d' dev{i}] )
Error in test (line 7)
saveas(gcf,'Image.jpg');
How to solve this problem? I want to save the figure in jpg format.
1 Kommentar
Abubakar Abba
am 11 Sep. 2021
It means you are trying to save a figure in an un identified path. Try to go to the actual directory and Run
the code again, it will work.
Akzeptierte Antwort
Weitere Antworten (1)
Safa Sharif
am 20 Jul. 2021
0 Stimmen
hi, im still getting this issue and have permission. can anyone advise why?
1 Kommentar
Abubakar Abba
am 11 Sep. 2021
It means you are trying to save a figure in an un identified path. Try to go to the actual directory and Run
the code again, it will work.
Kategorien
Mehr zu File Operations 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!