export_fig: Error when setting relative path
3 ビュー (過去 30 日間)
古いコメントを表示
Hi everyone!
When setting the relative path - in the export_fig function - an error occurs. Does anyone know what the problem might be? The folder 'Plots_Fig' already exists.
% export_fig /Plots_Fig/test.png -opengl -m8;
This version of the code just works fine:
% export_fig test.png -opengl -m8;
And this is the error message:
Error using imwrite (line 467)
Unable to open file "/Plots_Fig/test.png" for writing. You might not have write permission.
Error in export_fig (line 552)
imwrite(A, [options.name '.png'], 'ResolutionUnit', 'meter', 'XResolution', res,
'YResolution', res);
Error in DataPlotter (line 129)
export_fig /Plots_Fig/test.png -opengl -m8;
0 件のコメント
採用された回答
Walter Roberson
2017 年 10 月 8 日
export_fig /Plots_Fig/test.png -opengl -m8
does not use any relative paths. In Unix systems, a single leading / on a path name always refers to the root of the file system. If you want a relative path, either use ./ or leave off the leading / . So either
export_fig ./Plots_Fig/test.png -opengl -m8
or
export_fig Plots_Fig/test.png -opengl -m8
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Graphics Performance についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!