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!