I'm writing a small MATLAB package and I'd like to ask for user input for a function. So if the user enters:
x.^2 + sin(x)
I want to use this user input to appear elsewhere in the code, but x would already be defined and so the expression above would be a vector (or scalar if length(x) is 1).