Can I create a questdlg box with multiple yes/no options in the same box?
조회 수: 20 (최근 30일)
이전 댓글 표시
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.
댓글 수: 0
답변 (2개)
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.
댓글 수: 0
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
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 Exchange에서 Dialog Boxes에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!