How to link Radio button and Push button (Matlab GUI)
2 ビュー (過去 30 日間)
古いコメントを表示
When handles.radiobutton1 is selected then
user click the Push button the code is executed.
How to implement this? see attach file
0 件のコメント
採用された回答
Geoff Hayes
2015 年 4 月 5 日
Abraham - the easiest way to implement this GUI is through GUIDE using a callback for the push button. See the tutorials that can be found here.
2 件のコメント
Geoff Hayes
2015 年 4 月 5 日
Abraham - use the handles structure which is the third input to the push button callback as it has (at the least) the handles to all controls used in your GUI. For example,
function pushbutton1_Callback(hObject, eventdata, handles)
if get(handles.radiobutton1,'Value')
% do something
else
% do something else
end
その他の回答 (2 件)
Ali Noori
2015 年 6 月 25 日
To link between push button and radio button, do like this:
function pushbutton1_Callback(hObject, eventdata, handles)
if get(handles.radiobutton1,'Value') your function % do something end if get(handles.radiobutton2,'Value') your function % do something else end if get(handles.radiobutton3,'Value') your function %do someething else end end
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Startup and Shutdown についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!