这种情况,多数情况下设置一个变量就好了,不要用符号输入`
> f = sym('x^2');
Error using sym>convertChar (line 1448)
Character vectors and strings in the first argument can only specify a variable or number. To evaluate
character vectors and strings representing symbolic expressions, use ‘str2sym’.
Error in sym>tomupad (line 1214)
S = convertChar(x);
Error in sym (line 211)
S.s = tomupad(x);
**>> syms x;
>> f = sym(x^2);
>> int(f)**
ans =
x^3/3