How can I plot multiple lines on the graph?

조회 수: 2 (최근 30일)
Misbah Rashid
Misbah Rashid 2018년 12월 24일
편집: madhan ravi 2018년 12월 24일
Hello! I'm trying to graph a matching plot for aircraft sizing. However, only one plot is showing. How can I display all the other lines? My code is below:
Vs = 141;
Vc = 822;
Vmax = 1210;
Vto = 150;
Vr = Vto;
hc = 41000;
hac = 51000;
Clmax = 1.8;
e = 0.81;
AR = 8;
K = 0.049;
g = 32.2;
Cd0 = 0.017;
Cd0to = 0.032;
Clto = 1;
Cdto = 0.037;
Cdg = 0.001;
Clr = 1.48;
nu = 0.04;
Sto = 4000;
rhosl = 0.002378;
rhoc = 0.00056;
rhoac = 0.000347;
mupac = 0.235;
LDmax = 15;
ROCAC = 0;
ROCSC = 100;
ROCCrC = 3500;
ROCCoC = 500;
% Stall speed.
WS = 1/2*rhosl*Vs^2*Clmax;
x1 = WS;
x2 = WS;
y1 = 0;
y2 = 1.5;
plot([x1,x2],[y1,y2],'-g')
text(55,1.2,'Stall speed')
xlabel('W/S, lb/ft^2')
ylabel('T/W, lb/lb')
grid on
hold on
% Maximum speed.
WSms = 0:2:80;
TWvmax = (59./2*(W/S))+((0.00051)*(WS));
plot(WSms,TWvmax,'--r')
text(10,-0.05,'Maximum speed')
% Take-off run.
TWsto = (nu-(nu+Cdg/Clr).*(exp(0.6*rhosl*g*Cdg*Sto)./WSms))./((1-exp(0.6*rhosl*g*Cdg*Sto)./WSms));
plot(WSms, TWsto,'b--o')
text(5,1.2,'Take-off run')
% Rate of climb.
TWroc = (3500./(sqrt(451.*WSms)))+(1./15);
plot(WSms, TWroc,'*-c')
text(5,0.3,'Rate of climb')
% Cruise ceiling.
TWhc = (100./(0.19*sqrt(2324*WSms)))+(1./2.85);
plot(WSms, TWhc,'*-y')
text(10,0.5,'Cruise ceiling')
% Find design plot coordinates.
[xint,yint] = polyxpoly([x1,x2],[y1,y2],WSms,TWvmax);
plot(xint,yint,'ok')
text(65,-0.2,'Design point')
disp([xint,yint])

채택된 답변

madhan ravi
madhan ravi 2018년 12월 24일
hold on % after the first plot command
  댓글 수: 12
Misbah Rashid
Misbah Rashid 2018년 12월 24일
It works now. Thank you so much!
madhan ravi
madhan ravi 2018년 12월 24일
편집: madhan ravi 2018년 12월 24일
Anytime :) , make sure to accept the answer if it worked.
After all it was just to add hold on after the first plot command as I suggested at the very beginning.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interactive Control and Callbacks에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by