Displaying Files using a Listbox in a GUIDE GUI.

2 次查看(过去 30 天)
I have written a GUI that pulls data from a file and makes plots. Currently, I have coded a pushbutton to retrieve the files, but I want to put a listbox in the GUI that acts as a directory.
I figure this is a common operation, but I haven't been able to find much to get me started.

采纳的回答

Evan
Evan 2013-8-12
Where exactly are you running into trouble? Posting your relevant code so far might help. As for displaying the files in the listbox, to do that you just need to set the box's 'String' property.
d = dir; %get files
set(handles.my_listbox,'String',{d.name}) %set string
  8 个评论
DJ Sabio
DJ Sabio 2016-3-7
not working
[data,text] = xlsread('DB.xls','Users','B3:B100') % Read EXCEL file highlighted in listbox a = 'C:\Users\user\Documents\LogIn\DB.xls'; b = get(handles.lbox, 'string'); v = get(handles.lbox, 'value '); %get current selection value b = b{v}; %choose corresponding cell DB.xls = strcat(a,b); %Read columns from Sheet1 of selected file into MATLAB
Error in editemployee (line 42) gui_mainfcn(gui_State, varargin{:});

请先登录,再进行评论。

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Migrate GUIDE Apps 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by