How to load data in particular column of set of files in popup menu?
6 views (last 30 days)
Show older comments
I have an excel file whose header is displayed in pop up menu. When i select a particular header, it should be able to read data of set of files with that header, not the column of selected header alone. Along with that the obtained column value will be used in another push button. Feeling tough to solve this, Please someone help me in solving this.
3 Comments
Walter Roberson
on 22 Dec 2013
It sort of sounds to me as if the user will select an entry from the popup menu, with the entry indicating a header that you got from a file. Then when the header is selected, that you want the program to look through a set of files (which set) to find all the files in that set that have the same header (in the same position? In any column) and read data from all of those files (which data to read from the files?) Then someone the data read in is to be used to construct the action for another button?
Or is it the case that the selected column in the first file will have a list of files inside it, and those strings are what is to be used for the other button?
kodishwaran S
on 19 Oct 2015
I also having the same problem I have loaded the excel data using push button and the column names had 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 I am trying to load the data under this column by selecting the respective column name to the uitable. please help me to solve this issue
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!