使用Matlab使用X-Y轴绘制函数

时间:2018-12-01 02:19:33

标签: matlab plot

enter image description here

我想使用Matlab在[-2,2]上绘制f(x)= x ^ 3 -4x + 2的图。我的简单尝试是:

 f = @(x) x^3-4*x+2;
   fplot(f,[-2,2]);

输出未显示两个轴以原点为中心的图形,就像我想看到的上图一样。

如何以一种不太复杂的方式修改该输出(如上图所示)?

谢谢。

0 个答案:

没有答案