版本是2016a
Support of strings that are not valid variable names or define a number will be removed in a future release. To create symbolic
expressions, first create symbolic variables and then use operations on them.
你好同学,现在matlab版本支持单个变量的sym转换,但是对于表达式,那么应该用str2sym表示
你的只需要改成
f1 = str2sym('2*Heaviside(t+1)-Heaviside(t-1)')
即可
有帮助望采纳呢,谢谢啦(づ ̄3 ̄)づ╭❤~