error in getting output using pushbutton
Mostrar comentarios más antiguos
hi everyone..
im trying read a .fis file and evaluate it provided inputs from popupmenus,radiobuttons and textfield.i have written the following code.
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)
fismat=readfis('oralcancer_rulebase.fis');
out=evalfis([popupmenu2value popupmenu3value popupmenu4value num smokingvalue alcoholvalue gendervalue tumorsitevalue],fismat);
msgbox(sprintf('%d',out));
the following code is function of one of the popupmenu
function popupmenu2_Callback(hObject, eventdata, handles)
% hObject handle to popupmenu2 (see GCBO)
% eventdata reserved - to be defined in a future version of MATLAB
% handles structure with handles and user data (see GUIDATA)
% Hints: contents = cellstr(get(hObject,'String')) returns popupmenu2 contents as cell array
% contents{get(hObject,'Value')} returns selected item from popupmenu2
contents1=get(handles.popupmenu2, 'String');
popupmenu2value=contents1{get(handles.popupmenu2, 'Value')};
switch popupmenu2value
case '1'
handles.value=1;
case '2'
handles.value=2;
case '3'
handles.value=3;
case '4a'
handles.value=4;
case '4b'
handles.value=5;
case 'x'
handles.value=6;
end
but im getting errors as follows
Undefined function or variable 'popupmenu2value'.
Error in testgui>pushbutton1_Callback (line 261)
out=evalfis([popupmenu2value popupmenu3value popupmenu4value num smokingvalue
alcoholvalue gendervalue tumorsitevalue],fismat);
Error in gui_mainfcn (line 96)
feval(varargin{:});
Error in testgui (line 42)
gui_mainfcn(gui_State, varargin{:});
Error in
@(hObject,eventdata)testgui('pushbutton1_Callback',hObject,eventdata,guidata(hObject))
Error while evaluating uicontrol Callback
please provide me any solution. any kind of help will be appreciated
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Entering Commands en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!