How to assign a value using a RADIO Button in the GUI
古いコメントを表示
I want to use 2 radio buttons in a GUI in this way:
radiobutton1 -> acceleration = 1; radiobutton2 -> acceleration = -1;
Then I want to use this "acceleration" within other functions that are used by the GUI.
I've no problems with "Edit text", "Push buttons" and others, but I'm struggling with the Radio Button. For example I can use a value with the "Edit text" simply buy writing
value = handles.EDIT_TEXT;
But I'm not able to do the same with a radio button.
Thanks in advance!
採用された回答
その他の回答 (1 件)
Future Science
2012 年 6 月 20 日
0 投票
3 件のコメント
Walter Roberson
2012 年 6 月 20 日
After you have done the set() that debasish mentioned in step 3, then invoke
acceleration_buttongroup_SelectionChangeFcn( handles.acceleration_buttongroup, struct( 'NewValue', handles.accel1_radiobutton ) )
That is, you will be calling the callback routine with artificial values.
Future Science
2012 年 6 月 20 日
Preshma Linet Pereira
2015 年 3 月 25 日
thank you @walter roberson! really helped! was stuck with the same problem.
カテゴリ
ヘルプ センター および File Exchange で MATLAB についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!