How can i get value of another function in gui

3 次查看(过去 30 天)
How can i get value of checkbox inside another fuction?
For example:
function checkbox1_Callback(hObject, eventdata, handles)
....
....
function checkbox2_Callback(hObject, eventdata, handles)
%here i need to check state of function checkbox1
thanks!!

采纳的回答

Image Analyst
Image Analyst 2013-4-14
Simply use the get() function:
function checkbox2_Callback(hObject, eventdata, handles)
% Get the check state of checkbox1
checkbox1Value = get(handles.checkbox1, 'value');
% Now also get the check state of checkbox2
checkbox2Value = get(handles.checkbox2, 'value');

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Graphics Object Programming 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by