Hold on Not showing all of my plots on one graph

조회 수: 14 (최근 30일)
Ari Henderson
Ari Henderson 2020년 2월 4일
답변: Ari Henderson 2020년 2월 4일
Q = .07; %(kg/s)
H = 225; %(m)
x = 0.2:10^-3:100;
Bx = 0.2:10^-3:100;%(km)
y = 0 ;%(km)
z = 0; %(km)
U = 3.1 ;%(m/s)
a = 68;
b = .894;
if x < 1 %(km)
c = 33.2;
d = .725;
f = -1.7;
else c = 44.5;
d = .516;
f = -13;
sigmay = a*x.^b;
sigmaz = c*x.^d + f;
Ba = 156;
Bb = .894;
if x < 1 %(km)
Bc = 106.6;
Bd = 1.149;
Bf = 3.3;
else Bc = 108.2;
Bd = 1.098;
Bf = 2.0;
Bsigmay = a*Bx.^b;
Bsigmaz = c*Bx.^d + f;
loglog(Bx,Bsigmay,'b')
hold on
loglog(Bx,Bsigmaz,'r')
hold on
loglog(x,sigmay)
hold on
loglog(x,sigmaz)
end
end
I am trying to plot for lines on one graph but only two lines are showing up. I have used the "hold on" command but it still only plots two lines instead of four.

채택된 답변

Alex Mcaulley
Alex Mcaulley 2020년 2월 4일
Take a look at the variables you are plotting, they are duplicated. I mean Bsigmay is equal to sigmay, Bsigmaz is equal to sigmaz and Bx is equal to x. Then, your lines are overlapped and you can see just two lines.

추가 답변 (1개)

Ari Henderson
Ari Henderson 2020년 2월 4일
I realized that mistake right before you answered. Thank you!!!

카테고리

Help CenterFile Exchange에서 Graphics Performance에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by