How can I get the value of toggle button (uicontrol)
Show older comments
Hi fellow MATLAB users,
I have created a toggle button in a figure programmatically using uicontrol:
tb = uicontrol(gtfig, 'Style', 'togglebutton', 'String', 'Start/Stop', 'tag', 'togglebutton1', 'Position', [30 20 100 30])
How can I get its value after it's pressed? Apparently, the code:
button_state = get(hObject,'Value');
that is used in GUIDE can't be used here. Thank you for your help.
Accepted Answer
More Answers (1)
Mehdi
on 11 Mar 2015
0 votes
Categories
Find more on Programming in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!