필터 지우기
필터 지우기

store value of selected radio button from group button

조회 수: 4 (최근 30일)
fatemeh
fatemeh 2013년 12월 21일
댓글: Walter Roberson 2018년 8월 23일
i want get the value of selected radio button from button group i use this code:
u=get(handles.uipanel12,'SelectedObject');
but this code get me a number while the object is a string.(name and tag of radio button)
can u help me?
thanks

채택된 답변

Walter Roberson
Walter Roberson 2013년 12월 21일
편집: Walter Roberson 2013년 12월 21일
u = get(get(handles.uipanel12,'SelectedObject'), 'Value');
  댓글 수: 7
Sumera Yamin
Sumera Yamin 2018년 8월 23일
@ Walter Roberson Is it possible to set values of subsequent radio buttons to '3' and '4' ? So that when i select third or fourth radio buttons, only code relevant to that part is executed?
Walter Roberson
Walter Roberson 2018년 8월 23일
The Value property of a button will be equal to the button's Min property if the button is not selected, and equal to the button's Max property if the button is selected.
So you could set the buttons to have 'Max', 1 for the first button, 'Max', 2 for the second, 'Max' 3 for the third, and so on. Then the Value property of the current button would tell you which of the buttons had been selected.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

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