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!