打包exe后,dir函数无法读取exe内部文件夹数据。
Show older comments
编写GUI时,在OpeningFcn里写入一个dir语句,其中test是GUI同一目录下的一个文件夹,内部含有子文件夹,目的是要读取test内所有文件夹的名字,现发现,直接运行GUI程序时,dir函数可以正常读取数据,但是打包成exe后,确无法读取,寻求各位大神帮助!
function Database_OpeningFcn(hObject, eventdata, handles, varargin)
% This function has no output args, see OutputFcn.
% hObject handle to figure
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% varargin command line arguments to Database (see VARARGIN)
% Choose default command line output for Database
handles.output = hObject;
File_name=dir('test'); %该函数打包exe无法读取数据
% % Update handles structure
guidata(hObject, handles);
Accepted Answer
More Answers (0)
Categories
Find more on 编程 in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!