I want to plot a line but got a curve
11 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Réponse acceptée
Plus de réponses (1)
Alan Stevens
le 21 Août 2020
Just
t = (0:0.01:0.64)';
a = -9.81*ones(size(t));
plot(t,a)
gives a horizontal line.
0 commentaires
Voir également
Catégories
En savoir plus sur 2-D and 3-D Plots dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!