MATLAB: Entering a formula by user

beginnerMATLAB

Is there a function which allows me to ask for a formula, while the prgram is beeing used, and subsequently use that formula?

Best Answer

aMatrix = magic(5);
expression = input('Enter the name of a matrix: ','s');
if (exist(expression,'var'))
mesh(eval(expression))
end