八度图:如何设置正确的位置?

octave plot: how to set the correct position?

这是我在八度音阶中遇到的:

x = -100 : 100
plot(x.^3)

但我得到如下图。剧情好像把x=100这个点当成x=0了,为什么呢?以及如何解决?

具有 一个输入 plot 函数将该输入解释为 y 轴值,并假设 x-轴值为1, 2, 3, ...

要指定 x 轴值,请使用 plot 两个输入 :

plot(x, x.^3)