Hold on Not showing all of my plots on one graph

9 ビュー (過去 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 Center および File Exchange2-D and 3-D Plots についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by