MATLAB: How to add inputdlg to the code for taking input

inputinputdlg

%max chamber in terms of hunder
%max postion of chamber in terms of tenth
% thicknes
prompt={'enter max chamber','enter position of chamber','enter thicknes'};
title={'Input'};
dims = [1 65];
definput = {'2','2','12'};
answer=inputdlg(prompt,title,dims,definput)
m=answer*0.01;
p=answer*0.1;
t=answer*0.01;

Best Answer

Read the inputdlg documentation: it clearly states that the output is "a cell array of character vectors containing one input per edit field, starting from the top of the dialog box". You need to access the contents of the output cell array (which will be character vectors, exactly as the documentation states):
prompt = {'enter max chamber','enter position of chamber','enter thicknes'};
dfin = {'2','2','12'};
answer = inputdlg(prompt,'Input',[1,65],dfin);
answer{1} % 1st input
answer{2} % 2nd input
answer{3} % 3rd input
If the inputs are single numbers and you want to convert them to numeric, simply use
vec = str2double(answers)
and then use indexing to access them in vec.