Runing a .m file accordıng to the status of checkbox
조회 수: 3 (최근 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개)
참고 항목
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!