How may i resize a promt window?

prompt = {'Enter matrix size:','Enter colormap name:'};
dlgtitle = 'INPUT';
dims = [1 35];
definput = {'20','hsv'};
opts.Resize='on';
I want to create an input prompt tha is resizable but even if i digit " opts.Resize='on' i am not able to resize the dialog box.
Wich is my error?

10 Comments

@Pietro Fiondella - which version of MATLAB are you using? When I use your above code (R2021a), I can re-size the dialog (note the text controls don't expand or shrink as the dialog increases or decreases in size).
Which command do you sue to create the dialog?
Same behavior in 21b to what Geoff Hayes is reporting.
Jan what do you mean? I use prompt = { } ecc as in the script
I dont know why but it dosent work meaby it's a bug
@Pietro Fiondella: Jan is asking how you are creating the dialog box, e.g., with inputdlg or some other function, as in:
prompt = {'Enter matrix size:','Enter colormap name:'};
dlgtitle = 'INPUT';
dims = [1 35];
definput = {'20','hsv'};
opts.Resize='on';
% actually create the dialog box:
answers = inputdlg(prompt,dlgtitle,dims,definput,opts);
because your code above only sets up the options and doesn't actually tell us what you do with them.
Ok, well i whant to obtain this
prompt = {'Enter the number of users:','Enter the name of your city:','Enter the nominal power [kWh]'};
dlgtitle = 'Details';
dims = [1 35];
definput = {'20','hsv'};
opts.Resize='on';
If you have 3 prompts, then you have to have at least 3 default answers:
prompt = {'Enter the number of users:','Enter the name of your city:','Enter the nominal power [kWh]'};
dlgtitle = 'Details';
dims = [1 35];
% definput = {'20','hsv'};
definput = {'20','NYC','1000'};
opts.Resize='on';
% actually create the dialog box:
answers = inputdlg(prompt,dlgtitle,dims,definput,opts);
@Pietro Fiondella: You still did not mention, what you want to resize. Your code does not create anything resizable. Is Voss' assumption correct, that you call inputdlg?

Sign in to comment.

 Accepted Answer

AMIT POTE
AMIT POTE on 3 Jul 2022
You can go through the following documentation to read more about input dialog box

More Answers (0)

Products

Release

R2021b

Asked:

on 29 Jun 2022

Commented:

Jan
on 3 Jul 2022

Community Treasure Hunt

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

Start Hunting!