필터 지우기
필터 지우기

How to create multiple choice string input dailog box to get string input from user and then how to display that string...?

조회 수: 13 (최근 30일)
I'm writing one script for my education purpose, in that script i need to create multiple choice string input dialog box to get user input and Then i have to display that string...
I can do that by quetdlg command but this command is limited for only 3 input strings....
Script and errors shown below...plz help
Working Code is below...
clc
clear all
X=questdlg('Select Your Favourite','Input Choise','Chocolate','Candy','Nothing','Nothing');
Y=sprintf('%s is My Favourite',X);
disp(Y);
Non-Working code and error is below...
clc
clear all
X=questdlg('Select Your Favourite','Input Choise','Chocolate','Candy','Muffin','Lolipop','Nothing','Nothing');
Y=sprintf('%s is My Favourite',X);
disp(Y);
Error using questdlg
Too many input arguments.
Error in Untitled (line 3)
X=questdlg('Select Your Favourite','Input
Choise','Chocolate','Candy','Muffin','Lolipop','Nothing','Nothing');
Is there any solution for this or any other way to do so...?
Thx in Advance...

채택된 답변

Walter Roberson
Walter Roberson 2016년 8월 10일
See menu()
  댓글 수: 4
Kelvin Viroja
Kelvin Viroja 2016년 8월 12일
편집: Kelvin Viroja 2016년 8월 12일
Got it... It can be done by if-else loop...
if anyone want details about how to do it than please feel free to ask me..... THANKS

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Dialog Boxes에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by