Matlab not plotting in -ve direction
显示 更早的评论
I am trying to normally plot y=x^3, but matlaab is not plotting in -ve direction
my code is
x=linspace(-10,10,100);
y=x.^3;
plot(y)

please help me
回答(1 个)
Steven Lord
2019-2-20
0 个投票
- If Y is a vector, then the x-axis scale ranges from 1 to length(Y).
Instead you want:
- If X and Y are both vectors, then they must have equal length. The plot function plots Y versus X.
类别
在 帮助中心 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!