I am trying to combine plots to one graph for u, p and a. So i need three separate graphs in total but im having trouble combining the plots needed for each graph.

조회 수: 1 (최근 30일)
i am trying to make three separate graphs for u, p and a against t but im having trouble combining the graphs to make one figure (one for each)
this is my code
mi=2290000;
mf=130000;
tb=165;
t=linspace(0,165);
mr=mi-((mi-mf)*(t/tb));
g = 9.81;
Isp=263;
u=g.*(Isp.*log(mi./mr)-t);
p = cumtrapz(t,u);
hold all
a = gradient(t, u)
hold all
mi2=496200;
mf2=40100;
tb2=360;
t2=linspace(165,360);
mr2=mi2-((mi2-mf2)*(t2/tb2));
hold all
g = 9.81;
Isp=421;
u2=g.*(Isp.*log(mi./mr)-t2);
p2 = cumtrapz(t2,u2);
a2 = gradient(t2, u2)
f1=figure;
plot (t,u, 'red')
hold on
plot (t2,u2, 'red,---')
hold off
f2=figure;
plot(t,p,'blue')
hold on
plot(t2,p2,'blue,---')
hold off
f3=figure;
plot(t,a,'green')
hold on
plot(t2,a2,'green,---')
hold off

채택된 답변

Navya Seelam
Navya Seelam 2019년 12월 4일
Hi,
When you are trying to plot u2, try the following
plot (t2,u2, '--r')
Similarly for p2 and a2

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Directed Graphs에 대해 자세히 알아보기

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by