Making A table and a plot from a for loop
Afficher commentaires plus anciens
Hi,
Using data collected from the for loop, I have been trying to create
1) One table with 4 columns (t, v, a, h) , and
2) 3 different graphs with t on the x axis for all 3 graphs, and v, a, h on the y axis of the respective graph (ie. plot(t,v), plot(t,a), plot(t,h)).
Here is my loop:
for t= 0:4:80
t
a= u*(q/(wt-q*t))-g
v= u*log((wt)./(wt-q*t))- g*t
h= u*t - u*(((wt./q)-t).*log((wt)./(wt-q*t)))-0.5*g*t.^2
end
Here are the values:
wt=2400+2000;
q =25;
u =12000;
g =32.2;
I have tried multiple ways such as putting my data from the loop to an array and then making a table and 3 graphs, etc. However, it failed as I can't seem to store each of the variable values into an array. How can I solve this problem? Or is there another way to make the table and plot?
Please help.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur 2-D and 3-D Plots dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!