Plotting end points from different arrays
显示 更早的评论
This program has been used to plot graphs of various variables against time to see how they change. The variable Qe is changed by repeatedly decreasing by 0.1 and then the plots are put together on one graph. I was wanting to plot the end points of these variables (a, e, de, da) against Qe however I have been unable to do so. Any help is appreciated.
format long
g = 36;
M = 10000002;
a = zeros(M,1);
e = zeros(M,1);
da = zeros(M-1,1);
de = zeros(M-1,1);
T = [0:10000000];
e(1) = 0.0549;
a(1) = 0.3844e9;
for m = 0:10000000
de(m+1) = -(4.04562756e41 + ((2.75561858e40)/g)) * ((a(m+1))^(-13/2)) * e(m+1);
a(m+2) = a(m+1) + (da(m+1) * 3.154e7);
end
e = e(1:end-1);
a = a(1:end-1);
plot(T,e)
hold on
采纳的回答
更多回答(0 个)
类别
在 帮助中心 和 File Exchange 中查找有关 2-D and 3-D Plots 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
