【发布时间】:2014-04-04 01:22:37
【问题描述】:
所以我试图在 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)
ezplot(f)
使用 inlineeval 时出错(第 15 行)内联表达式出错 ==> 12+(-2t+8).*heaviside(t-2)+(2t-12).*heaviside(t-6) 错误:意外MATLAB 表达式。
inline/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, loopflag] = ezplotfeval(f, x);
ezplot 中的错误(第 145 行) [hp, cax] = ezplot1(cax, f{1}, vars, labels, args{:});
【问题讨论】:
标签: matlab function inline piecewise