Setting current directory as save location for executable guis?
조회 수: 1 (최근 30일)
이전 댓글 표시
I have a gui that performs an xlswrite function and creates a file called summary.xlsx in a folder. When I turn this into an executable I want the current directory of that executable to replace that filepath in xlswrite. What does this code look like?
댓글 수: 0
채택된 답변
Image Analyst
2015년 4월 27일
For Windows, the attached function works to find the "real" folder where the executable is, which is not where mfilename says it is.
댓글 수: 2
Image Analyst
2015년 4월 27일
No. You'd do something like
executableFolder] = GetExecutableFolder();
%Later in my code
fullFileName = fullfile(executableFolder, 'DataSummary.xlsx');
xlswrite(fullFileName , DataSummary,1,'A2')
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Use COM Objects in MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!