saving and replacing matlab figures in a specific directory

5 vues (au cours des 30 derniers jours)
Edimilson Leonel
Edimilson Leonel le 19 Juil 2013
Hi,
I need to save and/or replace (if already exist) matlab figures in a specific drectory, I'm using the following commands to save:
path = 'specific/directory'; name = 'figure_name'; saveas(gcf,[path,filesep,name],'png')
Is it possible to clear figures in the directory? How can I replace them?
Thanks

Réponses (1)

Ken Atwell
Ken Atwell le 19 Juil 2013
I think the path you are passing to saveas is a little messed up. The help function fullfile can help get it right:
saveas(gcf, fullfile(path, name), 'png')
  1 commentaire
Edimilson Leonel
Edimilson Leonel le 19 Juil 2013
Both sentences work well for saving, but now my problem is to get replace figures already saved.

Connectez-vous pour commenter.

Catégories

En savoir plus sur Printing and Saving dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by