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

18 views (last 30 days)
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.

Answers (2)

Image Analyst
Image Analyst on 24 Apr 2016
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 on 4 Apr 2019
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 Comments
Jakob Sievers
Jakob Sievers on 5 Apr 2019
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 :-)

Sign in to comment.

Categories

Find more on Dialog Boxes in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!