MATLAB: How enter variables into a dialogue box prompt

six simgastatistics

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);

Best Answer

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.2f',zu), ...
sprintf('Enter value TP value for zl = %2.2f',zl)};
Credit to Ben Abbott