MATLAB: How to introduce symbolic variables as input in a script

inputMATLABscriptsymbolic

I want to create a script that asks for values as inputs and I want some of those inputs to be symbolic. Is this possible? My script as for now is this:
syms teta;
syms a;
syms d;
iteration = 0;
T0n = eye(4);
links = input ('Introduce number of links ');
while iteration<links
iteration=iteration+1;
teta=input('teta value ');
a=input('a value ');
d=input('d value ');
alpha=input('alpha value ');
A=[cos(teta), -cos(alpha)*sin(teta), sin(alpha)*sin(teta), a*cos(teta);
sin(teta), cos(alpha)*cos(teta), -sin(alpha)*cos(teta), a*sin(teta);
0, sin(alpha), cos(alpha), d;
0, 0, 0, 1];
T0n=T0n*A
end
I would like the variables "teta", "a" and "d" to have symbolic value (the variable "alpha" has a numerical value so it doesn't matter) but when I try it doesn't allow me to (it says something like "Undefined function or variable 'teta1'"). I have tried puting the input as "teta1" and "syms (teta1)" but the message is the same. The rest of the code works well (tried with numerical values).
Many thanks for considering my request.

Best Answer

Run the following. It is exactly what you want:
iteration = 0;
T0n = eye(4);
links = input ('Introduce number of links ');
while iteration<links
iteration=iteration+1;
teta=sym(input('teta value\n','s'));
a=sym(input('a value\n','s'));
d=sym(input('d value\n','s'));
alpha=input('alpha value ');
A=[cos(teta), -cos(alpha)*sin(teta), sin(alpha)*sin(teta), a*cos(teta);
sin(teta), cos(alpha)*cos(teta), -sin(alpha)*cos(teta), a*sin(teta);
0, sin(alpha), cos(alpha), d;
0, 0, 0, 1];
T0n=T0n*A
end