i can't save my plot as a png

13 次查看(过去 30 天)
hi guys,
i've made a plot (errorbar plot to be precise) and i get it looking exactly as i want, but when i give MatLab the command
saveas(gcf,'ErrorPlot.png')
i get the following errors:
Error using matlab.graphics.internal.name (line 112)
Cannot create output file './ErrorPlot.png'.
Error in print (line 71)
pj = matlab.graphics.internal.name( pj );
Error in saveas (line 181)
print( h, name, ['-d' dev{i}])
can someone please help me?

采纳的回答

Walter Roberson
Walter Roberson 2022-5-25
You are cd to a directory that you do not have write access to. In particular you might be cd to the matlab installation directory.
  2 个评论
Adam Jurhs
Adam Jurhs 2022-5-25
ahhhh, ok thanks! i'm a newbie so i'm learning these things
Adam Jurhs
Adam Jurhs 2022-5-25
yep, i opend MatLab in my home directory, ran the code and it saved the plot as a png, thanks!

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Startup and Shutdown 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by