Why is there nothing on my graph?
Afficher commentaires plus anciens
% Constants A, B, and C for Water
A=11.6834
B=3816.44
C=46.13
for T=0:10:100 ;
P=10.^(A-(B./(C+T)))
end
plot(T,P);
axis([0 10 0 1])
xlabel ('Temperature [k]')
ylabel ('Pressure [bar]')
title ('Saturation Pressures for Water and Methanol')
Réponses (1)
Walter Roberson
le 27 Jan 2018
Each iteration of the for loop, you overwrite all of P.
I suggest you do not use a for loop. Instead:
T = 0:10:100;
P = 10.^(A-(B./(C+T)));
Catégories
En savoir plus sur Graph and Network Algorithms dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!