Displaying Files using a Listbox in a GUIDE GUI.

3 Ansichten (letzte 30 Tage)
Caleb
Caleb am 12 Aug. 2013
Kommentiert: DJ Sabio am 7 Mär. 2016
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.

Akzeptierte Antwort

Evan
Evan am 12 Aug. 2013
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 Kommentare
Evan
Evan am 12 Aug. 2013
No problem! Glad you have it working.
DJ Sabio
DJ Sabio am 7 Mär. 2016
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{:});

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Migrate GUIDE Apps finden Sie in Help Center und File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by