MATLAB: How do i convert x^2 to x.^2 (for example)

anonymous functionsymbolic function

So im doing a area between curves calculator, i have the symbolic part to graficate, but i also need the expression like a mathlab function for something of my code, i used to use the function 'matlabFunction' but it returns me this as example:
syms x; //declared of the start of code
f=x^2
f1=matlabFunction(f)
but f1 returns (@x)x.^2, i need that but without (@x), im not expert at MATLAB, so what im doing wrong or what i need to do? I'll appreciate your help!

Best Answer

You can apply that to char() of a symbolic expression if you need to, and sym() the result, but be warned that if you do then variables named might lose any special properties like assumptions.