How do I get data to a GUI from excel file

1 回表示 (過去 30 日間)
karan
karan 2011 年 11 月 17 日
i have tried doing this but have got repeated errors... so i added a pushbutton to open the browse dialog box so that i can select the file i want to extract the data from
function pushbutton4_Callback(hObject, eventdata, handles)
handles.pushbutton4_Callback = uigetfile;
guidata(hObject, handles);
and then use the file name to use in a xlsread shown below which is triggered by another push button *
*[num2] = xlsread(handles.pushbutton4_Callback);
For some reason this is not working ....any help any tips on adding multiple files for analysis

採用された回答

Fangjun Jiang
Fangjun Jiang 2011 年 11 月 17 日
Using the "handles.pushbutton4_Callback" for your Excel file name is really confusing. Also, it's better to specify the full path and name of the file.
[FileName,PathName]=uigetfile;
handles.ExcelFile=fullfile(PathName,FileName);
Then in other function, use
xlsread(handles.ExcelFile);
  4 件のコメント
Fangjun Jiang
Fangjun Jiang 2011 年 11 月 17 日
This sounds like developing an application rather than a particular question. It can be done but will certainly require you to add more elements to your GUI and do some coding. There are quite some examples in this link or your local document. http://www.mathworks.com/help/techdoc/creating_guis/f6-6010.html
Also, you can watch Doug's video on this tipic. http://blogs.mathworks.com/videos/category/gui-or-guide/
Post your particular question as you go along.
karan
karan 2011 年 11 月 18 日
I never knew about these videos...seems like they are going to be handy .although i am not quite clear when u said it can be done except it requires ``more elements`` to the GUI ...any hints and tips which might make it easier to follow.
yes this is for a small application....just as a stepping stone

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by