Multiple prompt/input with inputdlg according to a value
5 views (last 30 days)
Show older comments
Hi everybody, I am at the "visual" stage of my program and I want to simplify the input process.
The program works with a variable amount of colors which changes depending on the image that is analyzed.
After that, the user must introduce manually two treshhold values MIN/MAX for each color.
I would like to use inputdlg() to display as much prompt/inputs as needed according to the "colors" value.
Here a self made image of what I would like to have:

Thank you in advance.
5 Comments
madhan ravi
on 5 Jun 2020
Yes I was interpreting in another way xD. Nevertheless I admire the terms you use often.
dpb
on 5 Jun 2020
OK...just in case you didn't realize there was one in the arsenal... :)
"I admire the terms you use often."
Indeed, I don't see any point in not having a little fun and humor along the way! Glad somebody sees similarly.
Accepted Answer
Ameer Hamza
on 5 Jun 2020
Something like this
num_colors = 4;
prompts = cell(1, num_colors*2);
prompts(1:2:end) = compose('Enter min value for color %d', 1:num_colors);
prompts(2:2:end) = compose('Enter max value for color %d', 1:num_colors);
out = inputdlg(prompts)
More Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!