フィルターのクリア

Can I create a questdlg box with multiple yes/no options in the same box?

13 ビュー (過去 30 日間)
Adrian  Rodriguez
Adrian Rodriguez 2016 年 4 月 24 日
コメント済み: Jakob Sievers 2019 年 4 月 5 日
choice = questdlg('Living Room outlet', ...
'', ...
'On','Off','Off');
switch choice
case 'On'
disp(' Outlet is on.')
outlet = 1;
case 'Off'
disp(' Outlet is off.')
outlet = 2;
end
Right now, of course 2 options show up in the box, however I want the user to be able to select multiple 'on ' 'off' options within the same dlg box. For example:
Living Room: On Off
Master room: On Off
Bedroom: On Off
All of that in the same dlg box and still be able to implement other actions based on the users input.

回答 (2 件)

Image Analyst
Image Analyst 2016 年 4 月 24 日
You might want to setup a GUI with three static text labels and 3 pairs of radio buttons. Put the radio button pairs in a group panel, one panel per pair, so they will turn each other off when selected.

Jakob Sievers
Jakob Sievers 2019 年 4 月 4 日
This is an old question but I was wondering if anyone know of any solution to this question? If not I'll sit down and code it myself but I figured that I'd ask if it's been done (I haven't been able to find it yet) so as to not spend too much time on this.
What I need is not just more buttons than the current questdlg allows but essentially a number of on/off buttons which can be set as desired and then an ok and a cancel button at the bottom. Maybe someone knows of a solution to this problem?
Thanks in advance
  2 件のコメント
Image Analyst
Image Analyst 2019 年 4 月 4 日
Would the menu() function work for you?
Jakob Sievers
Jakob Sievers 2019 年 4 月 5 日
The mathworks page for menu() suggested to use listdlg instead so I had a look and that has the functionality that I was looking for so thanks for guiding me in the right direction :-)

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

カテゴリ

Help Center および File ExchangeDialog Boxes についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by