How do I plot eta only when it's then 0?
Afficher commentaires plus anciens
Hi everybody, and thanks for your help.
I need some help for the gollowing code:
- print rendimento only when eta>0
- evalute p02 p2 =((1+((eta.*deltaideal)/(T01*cp))).^(k/(k-1))); when m>0 and with p02=m^2 when m<0
while N<Nmax+1
U1 = (D1*pi.*N)/60;
U2 = (D2*pi.*N)/60;
alfa2b = atan((D1*tan(beta1b))/(sigma*D2));
deltaideal = sigma*(U2^2);
deltahii = 0.5.*((U1-((cot(beta1b).*m)/(ro1*Ai))).^2);
deltahid = 0.5.*(((sigma*D2*U1)/D1)-((m.*cot(alfa2b))/(ro1*Ad))).^2;
deltahfi = kf.*(m.^2);
deltahfd = kfd.*(m.^2);
deltan = deltanbf+deltanv+deltanc+deltand;
deltaloss = deltahii+deltahid+deltahfi+deltahfd;
eta = ((deltaideal)./(deltaideal+deltaloss))-deltan;
p2 =((1+((eta.*deltaideal)/(T01*cp))).^(k/(k-1)));
figure(1);
title('Rendimento')
xlabel('Mass Flow [kg/s]')
ylabel('eta')
grid on
plot(m,eta);
hold on
figure(2);
title('Pressione')
xlabel('Mass Flow [kg/s]')
ylabel('p02')
grid on
plot(m,p2);
hold on
N=N+Nincr
end
1 commentaire
prasanth s
le 17 Oct 2019
write the plot function inside the if condition
if eta>0
plot(m,eta);
end
Réponses (1)
Paul Rogers
le 17 Oct 2019
2 commentaires
Walter Roberson
le 17 Oct 2019
eta is a vector. What does it mean to print rendimento only when eta>0 ? Do you want non-positive values to be skipped in the plot?
Paul Rogers
le 17 Oct 2019
Catégories
En savoir plus sur Line Plots dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!