拉出以上控件,计算按钮上右键Callback
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)
a= str2num(get(handles.a,'String'));
b= str2num(get(handles.b,'String'));
set(handles.text2,'String',num2str(a+b))
点击计算,得到结果,