Runing a .m file accordıng to the status of checkbox
1 次查看(过去 30 天)
显示 更早的评论
hi all,
i have a litlle problem with checkbox status. For example i have a checkbox and pushbutton at GUİ when status of checkbox is unchecked i want to run A.m file otherwise i want to run B.m file. How can be done with easiest way ?
appriciate to your help
0 个评论
采纳的回答
Walter Roberson
2015-5-11
function yourcallback(src, event)
state = get(src, 'Value');
if state == 0
run('A.m');
else
run('B.m');
end
end
3 个评论
Walter Roberson
2015-5-12
Change
state = get(src, 'Value')
to refer to the handle for the checkbox instead of src. The method of finding the appropriate handle will depend upon how you constructed your GUI.
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 DSP Algorithm Acceleration 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!