Using pop-up menu to enable/disable a button group

I have 2 button groups and a pop-up menu to switch from one button group to another. I try using this code but it didn't work for me. What can I do?
switch get(hObject, 'Value')
case 1
set (handles.panel_LG, 'Visible', 'on')
set (handles.panel_Newton, 'Visible', 'off')
case 2
set (handles.panel_LG, 'Visible', 'off')
set (handles.panel_Newton, 'Visible', 'on')
end

1 件のコメント

Jan
Jan 2019 年 4 月 11 日
編集済み: Jan 2019 年 4 月 11 日
Please mention, what "didn't work" means. Do you get an error message or does the result differ from your expectations? Where is this code stored? What is hObject? What is the value of hObject.Value?
I have removed a duplicate question posted at the same time.

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

回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeInteractive Control and Callbacks についてさらに検索

質問済み:

Via
2019 年 4 月 11 日

編集済み:

Jan
2019 年 4 月 11 日

Community Treasure Hunt

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

Start Hunting!

Translated by