フィルターのクリア

How to display a different SELECT menu depending on the radiobutton using MATLAB gui?

5 ビュー (過去 30 日間)
Gee Cheng Mun
Gee Cheng Mun 2016 年 1 月 13 日
コメント済み: Adam 2016 年 1 月 14 日
I would to create two different radio button which is able to direct to their respective SELECT menu. How can I do this in MATLAB?

回答 (1 件)

Adam
Adam 2016 年 1 月 13 日
Using GUIDE is the simplest method as it will setup the (empty) callbacks for you and allow you to position the radio buttons as you want (make sure you put them inside a Button Group though.
The documentation gives examples of creating a uibuttongroup programmatically using the SelectionChangedFcn as the callback to control all radio buttons within the group.
doc uibuttongroup
The SelectionChangedFcn can also be set for a GUIDE GUI by right-clicking in your button group in GUIDE and selecting 'View Callbacks'. Selecting it from this list will create the empty callback function for you to fill in as you would in the programmatic example.
Within that callback you can distinguish the clicked radio button either by string or tag. I favour tag, but it helps to make sure you set a useful tag name on each radio button when you do this rather than just radiobutton1, radiobutton2, etc.
  2 件のコメント
Gee Cheng Mun
Gee Cheng Mun 2016 年 1 月 14 日
Is it okay if you can show me some examples using the code?
Adam
Adam 2016 年 1 月 14 日
The example on the help page for uibuttongroup shows how to set up radio buttons with a callback programmatically. In GUIDE it is simpler, but can't be shown here without attaching an actual .fig and .m file which I don't have time to do.
What you do in the SelectionChangedCallback depends entirely on how you want to respond to the two radio buttons. I don't know what you are wanting to do as a "select" menu doesn't really mean anything to me.

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMigrate GUIDE Apps についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by