how can i take xls file from the user in gui and use it on the xlsread after in my proggram?

i want in my proggram to take the xls file from gui that had been selected from the user.after when i make the xlsread with that file that the user chose

Antworten (1)

sixwwwwww
sixwwwwww am 18 Okt. 2013
Bearbeitet: sixwwwwww am 18 Okt. 2013
Dear Eraklis, You can do like this (for example, in a callback of a button):
[FileName,PathName] = uigetfile({'*.*'; '*.xlsx'; '*.xls'},'Select the Excel file');
num = xlsread(fullfile(PathName, FileName), 'B:B');

3 Kommentare

[FileName,PathName] = uigetfile({'*.*'; '*.xlsx'; '*.xls'},'Select the Excel file'); on this commant the user will select the xls file
Do you have another question? If no more questions, then go ahead and mark this answer as Accepted.
Yes. You can put this command under the callback of a push button like this:
function pushbutton4_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton4 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
[FileName,PathName] = uigetfile({'*.*'; '*.xlsx'; '*.xls'},'Select the Excel file');
num = xlsread(fullfile(PathName, FileName), 'B:B')

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu App Building finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 18 Okt. 2013

Kommentiert:

am 19 Okt. 2013

Community Treasure Hunt

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

Start Hunting!

Translated by