Borrar filtros
Borrar filtros

export_fig: Error when setting relative path

2 visualizaciones (últimos 30 días)
Peter Bu
Peter Bu el 8 de Oct. de 2017
Comentada: Peter Bu el 8 de Oct. de 2017
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;

Respuesta aceptada

Walter Roberson
Walter Roberson el 8 de Oct. de 2017
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

Más respuestas (0)

Categorías

Más información sobre Graphics Performance en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by