因此,我试图用MATLAB中的heaviside函数和ezplot函数来绘制f(t),这是一个分段函数。现在我对MATLAB一点也不熟悉。如果有人知道我为什么会犯这个错误,那将是有帮助的。
F= '12+(-2t+8)*heaviside(t-2)+(2t-12)*heaviside(t-6)‘ F= 12+(-2t+8)*heaviside(t-2)+(2t-12)*heaviside(t-6) 电图(F)
内联表达式中使用内联12+(-2t+8).*heaviside(t-2)+(2t-12).*heaviside(t-6)错误(第15行)错误:意外的==>表达式。
内联/feval中的错误(第34行) INLINE_OUT_ = inlineeval(INLINE_INPUTS_,INLINE_OBJ_.inputExpr,INLINE_OBJ_.expr);
ezplotfeval中的错误(第52行)z= feval(f,x(1));
ezplot>ezplot1 (第469行) y,f,环标志= ezplotfeval(f,x)中的错误;
在ezplot (第145行) hp中出错,cax = ezplot1(cax,f{1},vars,标签,args{:});
发布于 2014-04-04 01:33:00
你需要告诉Matlab显式乘法,使用2*t代替2t。
syms t real
f = 12+(-2*t+8)*heaviside(t-2)+(2*t-12)*heaviside(t-6)
ezplot(f,[0 10])https://stackoverflow.com/questions/22851871
复制相似问题