saving and replacing matlab figures in a specific directory

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

답변 (1개)

Ken Atwell
Ken Atwell 2013년 7월 19일
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

Both sentences work well for saving, but now my problem is to get replace figures already saved.

댓글을 달려면 로그인하십시오.

카테고리

도움말 센터File Exchange에서 File Operations에 대해 자세히 알아보기

질문:

2013년 7월 19일

Community Treasure Hunt

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

Start Hunting!

Translated by