Using Export_fig to save a plot as it's original file name
조회 수: 1 (최근 30일)
이전 댓글 표시
So I'm trying to automate the saving of my plots with export_fig, but in my script i have declared a global variable as the file name (ex. plot title).
my code for the global variable looks like this:
% creates the global variable
global file_to_get;
% used to select the file path needed for uiimport
file_to_get = uigetfile({'*.csv*'}, 'Select the CSV File', 'file path');
Is there a way to use export_fig to save my plots as the file_to_get name? and then is there a way to add something to that title, for example file_to_get plot.jpg.
Thanks
댓글 수: 0
채택된 답변
Walter Roberson
2012년 6월 18일
outfilename = regexprep(file_to_get, '.csv', ' plot.jpg');
export_fig(outfilename, ....)
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Graphics Object Programming에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!