Why is there nothing on my graph?

% 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')

Answers (1)

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)));

Categories

Find more on Graph and Network Algorithms in Help Center and File Exchange

Tags

Asked:

on 27 Jan 2018

Answered:

on 27 Jan 2018

Community Treasure Hunt

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

Start Hunting!