How can i load a List Box with filepath and filename using multiple selected file by uigetfile() ???
7 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Ruhul Amin
am 20 Jun. 2015
Kommentiert: Ruhul Amin
am 20 Jun. 2015
I want to create a MATLAB GUI that contains tow object: a push button and a list box. I want to use the push button for browse multiple file. After selecting multiple file i want to load filepath and filename into list box. Here is my code:
function pushButton1_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile('MultiSelect','on');
set(handles.listbox1, 'String', [pathname,filename]);
It works when i select single file. It dose not work when i select multiple file. I don't know how to handle it. Please Help.....
Thanks In Advance.... :)
0 Kommentare
Akzeptierte Antwort
Azzi Abdelmalek
am 20 Jun. 2015
Try this
function pushButton1_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile('MultiSelect','on');
set(handles.listbox1, 'String', fullfile(pathname,filename));
3 Kommentare
Azzi Abdelmalek
am 20 Jun. 2015
try this
function pushButton1_Callback(hObject, eventdata, handles)
[filename, pathname] = uigetfile('MultiSelect','on');
f=cellfun(@(x) fullfile(pathname,x),cellstr(filename),'un',0)
set(handles.listbox1, 'String',f)
Weitere Antworten (0)
Siehe auch
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!