MATLAB: Exp(t^2) function error in zero .

symbolic

Hello
I typed the symbolic function exp(t^2) using Matlab symbolic toolbox. When trying to evaluate the function in 0 I got the following error :
_Error using sym>checkindex (line 1562) Index must be a positive integer or logical.
Error in sym>privformatscalar (line 1509) checkindex(x);
Error in sym>privformat (line 1493) s = privformatscalar(x);
Error in sym/subsref (line 707) [inds{k},refs{k}] = privformat(inds{k});_
Can anyone explain me what is going wrong ? Thanks in advance

Best Answer

syms t
F = exp(t^2);
subs(F,0)
ans =
1
Works fine for me.
My guess is you defined a variable called exp. Or maybe something silly like like subs. Try typing whos at the command line, and look to see if you defined a variable with a name that is allocated normally to some function you then tried to use.
The simple answer is ... DON'T DO THAT! When you name a variable with something like exp, and then try to use the FUNCTION exp, MATLAB gets confused. Wouldn't you? MATLAB is sitting there, trying to figure out, which exp does he want me to use? How can MATLAB know that you have done this?