Displaying Files using a Listbox in a GUIDE GUI.

3 visualizaciones (últimos 30 días)
Caleb
Caleb el 12 de Ag. de 2013
Comentada: DJ Sabio el 7 de Mzo. de 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.

Respuesta aceptada

Evan
Evan el 12 de Ag. de 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 comentarios
Evan
Evan el 12 de Ag. de 2013
No problem! Glad you have it working.
DJ Sabio
DJ Sabio el 7 de Mzo. de 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{:});

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Migrate GUIDE Apps en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by