copying the excel data to uitable
17 ビュー (過去 30 日間)
古いコメントを表示
I am new to Matlab, I am having some trouble, I have loaded the excel data using push button and I want to update the data in uitable by selecting the column headers updated in the popup menu, the column names are added in the popup menu by using this code.
function pushbutton_Load_data_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton_Load_data (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
handles.output = hObject;
filename=uigetfile({'*.xls';'*.csv'});
handles.filename=filename;
guidata(hObject, handles);
setpopupmenuString(handles.popupmenuA,eventdata,handles)
setpopupmenuString(handles.popupmenuB,eventdata,handles)
function setpopupmenuString(hObject,eventdata,handles)
filename=handles.filename;
[numbers,colNames]=xlsread(filename);
set(hObject,'String',colNames(1,:));
class(colNames)
size(colNames)
colNames{1,1}
now my problem is, trying to load the update the data in uitable under its respective column name by selecting the column name in popup menu. please help me to solve this issue.
2 件のコメント
TastyPastry
2015 年 10 月 19 日
A few clarification questions:
You're loading a spreadsheet with column headers. Do they match your uitable() headers?
Does your popup menu allow the user to select to load the data into any of the columns?
Does the popup menu contain all the columns of your uitable()?
回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Develop Apps Using App Designer についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!