Error with popupmenu using GUIDE
Show older comments
Hi. i am using GUIDE to make my GUI where you can access GUI of different functions from an main GUI. i am having a problem when using the popupmenu. i get its value from a pushbutton. i am getting an error everytime i use this code. my code and ans error are as follows. plz tell me what i am doing wrong. thanks
function pushbutton1_Callback(hObject, eventdata, handles)
% hObject handle to pushbutton1 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
%hAxes = findobj(gcf, 'type' ,'axes');
% template=null;
% tem=null;
user_Image = getappdata(Main_GUI,'theimage');
handles = guidata(hObject);
% handles.popupmenu1=gco;
tem = get(handles.popupmenu1,'Value');
guidata(hObjects,handles);
tem
%template put name of figure against each value from menu
if tem==1
template=imread('modal_breast_A.jpg');
if tem==2
template=imread('BREASTnormal1pp.jpg');
end
end
SPOT_MATCHING(user_Image,template);
Attempt to reference field of non-structure array. Error in Match_Spots>pushbutton1_Callback (line 136) tem = get(handles.popupmenu1,'Value'); Error in gui_mainfcn (line 96) feval(varargin{:}); Error in Match_Spots (line 42) gui_mainfcn(gui_State, varargin{:}); Error in @(hObject,eventdata)Match_Spots('pushbutton1_Callback',hObject,eventdata,guidata(hObject)) Error while evaluating uicontrol Callback
Accepted Answer
More Answers (0)
Categories
Find more on Adding custom doc 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!