copying the excel data to uitable
17 views (last 30 days)
Show older comments
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 Comments
TastyPastry
on 19 Oct 2015
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()?
Answers (0)
See Also
Categories
Find more on Develop Apps Using App Designer in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!