MATLAB: How to display the information from inputdlg into a text-box

guiguideinputdlgmatlab guitext box

Hello! I have this code:
x = inputdlg({'Name','Age','Height'},
'Patient Data', [1 50; 1 12; 1 7]);
And, while i'm putting the information, I want it to be shown in a text-box that I have, so that that it can be visible.
How can I do it??

Best Answer

Assuming the "Patient data" box in your png file already exists in a GUI, you just need to assign the values from x output to the string property of each component. For example, let's say the handle to the 'Name' field is H.
x = inputdlg(...);
H.String = x{1};