I want to plot a line but got a curve
1 次查看(过去 30 天)
显示 更早的评论
In my data, t = (0:0.01:0.64)', a is a colunm of constants (-9.81) of length 63. I want to plot a vs. t. It's supposed to be a horizontal line, but I got a graph with fluctuations around -9.81. How can I fix this? I used this code:
plot(t(1:length(a)),a)
3 个评论
采纳的回答
更多回答(1 个)
Alan Stevens
2020-8-21
Just
t = (0:0.01:0.64)';
a = -9.81*ones(size(t));
plot(t,a)
gives a horizontal line.
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Annotations 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!