Question

Write a script that will use the listdlg function to prompt user to select one color...

Write a script that will use the listdlg function to prompt user to select one color from three color names, and then print the color name according to the choice.
0 0
Add a comment Improve this question Transcribed image text
Answer #1

In case of any queries, please revert back. I have used OCTAVE but the code and logic remains exactly the same.

##### CODE #######

# Usage of listdlg function in MATLAB

# Define the comma separated color list.
colorList={"Red","Blue","Green"};

#Call the DLG function and input the colorList
[indexOfSelection,boolSelect]=listdlg('ListString',colorList);

#Display the result
disp("The color selected is ")
colorList(indexOfSelection)

##### END #####

Add a comment
Know the answer?
Add Answer to:
Write a script that will use the listdlg function to prompt user to select one color...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT