How enter variables into a dialogue box prompt
Show older comments
I am trying to create a dialogue box to prompt the user to reference a z-table to find the Tail Proportion for a bell curve. I want to put the calulated limits, zl and zu in the prompt so it is easy to identify the z values.
Let's say:
zu = 1.55
zl = 1.45
I currently have:
I noticed fprintf doesn't work here
prompt = {'Use the Z table to find the Tail Proportion for zl and zu\n', fprintdf('Enter value TP value for zu = %2.2',zu),...
fprintf('Enter value TP value for zl = %2.2',zl)};
answer = inputdlg(prompt);
4 Comments
Ben Abbott
on 7 Nov 2020
fprintf() is intended to print to the command line or to a file. To create a char variable try sprintf(). Try ...
prompt = {'Use the Z table to find the Tail Proportion for zl and zu\n', sprintf('Enter value TP value for zu = %2.2',zu), ...
sprintf('Enter value TP value for zl = %2.2',zl)};
Kyle Balas
on 7 Nov 2020
Ben Abbott
on 7 Nov 2020
'help inputdlg' provides the proper sytax. The fourth input can be used to specify default answers.
inputdlg (prompt, 'Please Enter 3 values', 1, {'1', '2', '3'})
Kyle Balas
on 7 Nov 2020
Accepted Answer
More Answers (0)
Categories
Find more on Tables in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!