필터 지우기
필터 지우기

How to link Radio button and Push button (Matlab GUI)

조회 수: 1 (최근 30일)
Abraham Chan
Abraham Chan 2015년 4월 5일
답변: Ali Noori 2015년 6월 25일
When handles.radiobutton1 is selected then
user click the Push button the code is executed.
How to implement this? see attach file

채택된 답변

Geoff Hayes
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
Abraham Chan
Abraham Chan 2015년 4월 5일
Yeah i know that.I dont know how to link Radio button and Push button
Geoff Hayes
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
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

Ali Noori
Ali Noori 2015년 6월 25일
To link between push button and radio button, see attached file:

카테고리

Help CenterFile Exchange에서 Migrate GUIDE Apps에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by