I created a Load Button which loads the excel file then I want to populate a pop up menu from column E of this file. How can I do that? Currently this give me an error
hload = uicontrol(f,'Style','pushbutton','String','Load Data',... 'Position',[380,260,70,25],... 'Callback',{@loadbutton_Callback});hsubject = uicontrol(f,'Style','popupmenu',... 'String',{'Injury Level'},... 'Position',[5,260,100,25],... 'Callback',{@subjectpopup_menu_Callback});%Each callback prompts user to select file to load and display.
function loadbutton_Callback(hObject, eventdata, handles) disp('Hello 1'); [file] = uigetfile('.xlsx'); disp(file); [num,txt,raw] = xlsread(file,'E2:E9'); disp(txt); set(handles.Injury,'String',txt); guidata(txt,handles.hsubject); %save data to gui
updateTable(txt); %update Table
end
Best Answer