Info

この質問は閉じられています。 編集または回答するには再度開いてください。

how can i store each iteration values in a metrix to plot a straight line graph

1 回表示 (過去 30 日間)
omar mahallawy
omar mahallawy 2018 年 12 月 17 日
閉鎖済み: MATLAB Answer Bot 2021 年 8 月 20 日
clear,clc,clf
format long
Q=0.03;
rouh=847;
g=9.81;
Gamma=(rouh.*g);
Zs=0;
Ze=0;
L=500;
Ks=(6*10.^-5);
viscosity=(1.1*10.^-6);
V=1.34:0.5:4.5
for I=1
D=sqrt(((4.*Q))./(V.*pi))
end
Re=(V.*D./viscosity)
Er=(1.*10.^-8);
Fo=0.01;
for I=0:1:10^6;
Fn=(1./(-4.*log10((Ks./(3.71.*D))+((1.26)./(Re.*sqrt(Fo)))))).^2;
E=abs((Fn-Fo)/Fn);
if E<=Er;
display(Fn),display(E),break,
end
if E>Er;
Fo=Fn;
end
end
Hloss=((Fn.*L.*Q.^2)./(12.*D.^5))
Hpump=Hloss+Ze-Zs
%calculating Hloss every 100M
for HLC=(1:100:500);
HLC
HlossN=((Fn.*HLC.*Q.^2)./(12.*D.^5))
TEL=(Hpump-HlossN+Zs)
HGL=(TEL-((V.^2)./2.*g))
KE=(TEL-HGL)
end
  2 件のコメント
Image Analyst
Image Analyst 2018 年 12 月 18 日
編集済み: Image Analyst 2018 年 12 月 18 日
What variable do you want for y and what do you want for x?
None of your variables in your loops have indexes so the values are being overwritten on every iteration. So after the loop ends, all you have is a scalar, not a list of values. Is that what you want?
omar mahallawy
omar mahallawy 2018 年 12 月 18 日
well i need to plot a graph between HLC (X AXIS) and TEL (Y AXIS) and HGL (Y AXIS) i should get two parallel lines on seven seperate graphs using "subplot". that's why i need to sotre the values first and then plot a graph

回答 (0 件)

この質問は閉じられています。

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by