store value of selected radio button from group button
2 ビュー (過去 30 日間)
古いコメントを表示
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
0 件のコメント
採用された回答
Walter Roberson
2013 年 12 月 21 日
編集済み: Walter Roberson
2013 年 12 月 21 日
u = get(get(handles.uipanel12,'SelectedObject'), 'Value');
7 件のコメント
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
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 Center および File Exchange で Dialog Boxes についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!