the use of ezplot function
1 次查看(过去 30 天)
显示 更早的评论
Would you please explain the use of ezplot function. Why it is giving a warning in this case? Thanks
>> d
d =
'x^2 –6*x – 12'
>> ezplot(d)
Error using inlineeval (line 14)
Error in inline expression ==> x.^2 –6.*x – 12
Error: The input character is not valid in MATLAB statements or expressions.
Error in inline/feval (line 33)
INLINE_OUT_ = inlineeval(INLINE_INPUTS_, INLINE_OBJ_.inputExpr, INLINE_OBJ_.expr);
Error in ezplotfeval (line 51)
z = feval(f,x(1));
Error in ezplot>ezplot1 (line 482)
[y, f, loopflag] = ezplotfeval(f, x);
Error in ezplot (line 154)
[hp, cax] = ezplot1(cax, f{1}, vars, labels, args{:});
0 个评论
回答(2 个)
Star Strider
2020-11-7
You need to use the (-) sign, not char(8211) for the minus sign.
Also, character arrays are no longer usable with the Symbolic Math Toolbox.
Try this instead:
syms x
d = x^2 - 6*x - 12;
figure
ezplot(d)
figure
fplot(d)
Bothe of these work with your function.
1 个评论
Star Strider
2020-11-7
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!