syms eq1 eq2 cond y f teq1='D2y+4 *Dy+3 *y=f';eq2='f=heaviside(t)';cond='y(-0.01)=0,Dy(-0.01)=0,D2y(-0.01)=0';ans=dsolve(eq1,eq2,cond);simplify(ans,y);plot(t,y);
出错 yi (line 5)ans=dsolve(eq1,eq2,cond);
MatlabR2016a
看看函数的参数,是否合法。