How to create multiple answers accepted questions in Matlab script?

I want to create a question in the script asking the user to choose multiple answers but with questdlg I can only accept 1 answer. Is there anyway I can do this without using GUI/AppDesigner becaus eI'm very new and get confused on linking the 2 things so I would perfer to have them all on script? Thank you!

2 Comments

oh nvm I figured it out. Thank you!
Just another question, if I want to link the designer app coding box to script, how should I do it? My intend is to make the box work as a "function" in the Matlab script not the other way around. This is because the selection options/names from the box will come from the script code user input.

Sign in to comment.

 Accepted Answer

Use function listdlg with multiple SelectionMode.

4 Comments

I already did try that but it still only let me do one selection. Below is just a piece of code from matlab I copy down to play around and adjust to see how it works.
list = {'Red','Yellow','Blue',...
'Green','Orange','Purple'};
[indx,tf] = listdlg('SelectionMode','multiple','ListString',list);
Select the items with 'Control' key pressed
Just another question, if I want to link the designer app coding box to script, how should I do it? My intend is to make the box work as a "function" in the Matlab script not the other way around. This is because the selection options/names from the box will come from the script code user input.

Sign in to comment.

More Answers (0)

Categories

Find more on App Building in Help Center and File Exchange

Asked:

on 17 Jun 2022

Commented:

on 17 Jun 2022

Community Treasure Hunt

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

Start Hunting!