fplot画图出现错误,如何解决?

조회 수: 3 (최근 30일)
water luo
water luo 2019년 1월 23일
답변: fcrefw dew 2021년 11월 15일
本人初学matlab,下面请教一个小问题,请大神给以帮助:
syms x
f1=sin(x)/(x^2-x+0.5)+cos(x)/(x^2+2*x-0.5);
f2=log(sin(x)^2+2*sin(x)+8)
subplot(2,2,1),fplot(x,sin(x)/(x^2-x+0.5)+cos(x)/(x^2+2*x-0.5),[0,1],':r')
错误使用 fcnchk(line 106)
如果FUN为MATLAB对象,则它必须具有feval方法。
出错 fplot(line 62)
fun=fcnchk(fun)

답변 (1개)

fcrefw dew
fcrefw dew 2021년 11월 15일
可能跟matlab版本有关系,论坛自带的matlab 2021b可以运行,如下所示
syms x
fplot(sin(x)/(x^2-x+0.5)+cos(x)/(x^2+2*x-0.5),[0,1],':r')
matlab 2014a需要inline函数才可以运行
syms x
fplot(inline(sin(x)/(x^2-x+0.5)+cos(x)/(x^2+2*x-0.5)),[0,1],':r')

카테고리

Help CenterFile Exchange에서 Calculus에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!