吧务
level 10
并非如此。至于为什么你第一条指令会失败,帮助文档中的这两条已经解释:
1. Plot treats the variable x as local, effectively using Block.
2. Plot has attribute HoldAll and evaluates f only after assigning specific numerical values to x.
我懒得具体解释,写几条有效的给你研究
Plot[Evaluate@D[x^4*Sin[x+1]-x^2,x],{x,-2,2}]
With[{expr=D[x^4*Sin[x+1]-x^2,x]},Plot[expr,{x,-2,2}]]
Plot[#,{x,-2,2}]&@D[x^4*Sin[x+1]-x^2,x]
Plot[Function[x,x^4*Sin[x+1]-x^2]'[x],{x,-2,2}]
Plot[Block[{x},D[x^4*Sin[x+1]-x^2,x]],{x,-2,2}]
Plot[D[x^4*Sin[x+1]-x^2,x]/.x->vx,{vx,-2,2}]
(最后一条不推荐,容易理解但执行效率稍低点)
2020年09月08日 06点09分
4
懂了( ̄∀ ̄),谢谢大佬
2020年09月08日 06点09分
还有个问题,是版本问题吗,我的帮助文档里没这两条解释,因为刚开始学所以下的5.0
2020年09月08日 06点09分