How can i get value of another function in gui

6 views (last 30 days)
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!!

Accepted Answer

Image Analyst
Image Analyst on 14 Apr 2013
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');

More Answers (0)

Categories

Find more on Graphics Object Programming 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!