首页 > 其他分享 >hObject==handles.pushbutton1;sprintf('handles.pushbutton1 is %d',handles.pushbutton1)

hObject==handles.pushbutton1;sprintf('handles.pushbutton1 is %d',handles.pushbutton1)

时间:2023-06-18 15:03:04浏览次数:40  
标签:ch handles hObject sprintf ans pushbutton1


% --- Executes on button press in pushbutton1.
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)
ch_1=get(handles.checkbox1,'value');
ch_2=get(handles.checkbox2,'value');
if ch_1==1
 if ch_2==1
 x=0:10;
 else
 x=0:5;
 end
else
 if ch_2==1
 x=5:10;
 else
 x=0;
 end
end
ra_1=get(handles.radiobutton1,'value'); 
ra_2=get(handles.radiobutton2,'value'); 
if ra_1==1 
    a=5; 
else
     a=10; 
end 

y=a*sin(x); 
set(handles.edit1,'string',num2str(y));

%z=handles.checkbox1
sprintf('handles.checkbox1 is %d',handles.checkbox1)
%z=handles.checkbox2
sprintf('handles.checkbox2 is %d',handles.checkbox2)
%z=hObject
sprintf('hObject is %d',hObject)
%handles.pushbutton1
sprintf('handles.pushbutton1 is %d',handles.pushbutton1)
hObject==handles.pushbutton1

ans =

handles.checkbox1 is 1.890035e+002


ans =

handles.checkbox2 is 1.900035e+002


ans =

hObject is 1.940035e+002


ans =

handles.pushbutton1 is 1.940035e+002


ans =

     1

>>



标签:ch,handles,hObject,sprintf,ans,pushbutton1
From: https://blog.51cto.com/gjwrxz/6508456

相关文章