Plotting multiple figures: one figure doesnt show and the other is wrong
Show older comments
vo=10; %%dm^3/min
T=27+273.15; %%k
p=4; %%atm
R=82060; %%dm^3*atm/(k*mol)
k1=.004; %%(mol/dm^3)^.5*min
k2=.3; %%min^-1
k3=.25; %%DM^3/MOL*MIN
cao=p/(R*T);
ca=linspace(cao,.000005);
rx=k1*ca.^(1/2);
rb=k2*ca;
ry=k3*ca.^2;
sby=rb./ry;
sbx=rb./rx;
sbxy=rb./(rx+ry);
plot(ca,sbx,ca,sby,ca,sbxy)
%%hold on
%%plot(ca,sby)
%%plot(ca,sbxy)
xlabel('Ca')
title('Sb/y,Sb/x,Sb/xy Vs. Ca')
legend({'Sb/x','Sb/y','Sb/xy'},'Location','Southwest')
5 Comments
Tommy
on 10 Apr 2020
Only one figure shows because you only call plot once. What about the figure is wrong?
Rodrigo Blas
on 10 Apr 2020
Tommy
on 10 Apr 2020
Oh I see. All three are actually showing, but sbx and sbxy are very close in value, so sbx is hard to see. Use
plot(ca,sbx,'*')
hold on
plot(ca,sby)
hold on
plot(ca,sbxy)
hold off
if you want to verify.
Further, sbx and sbxy only appear to be horizontal lines at 0. Use
plot(ca,sbx,'*')
hold on
%plot(ca,sby)
hold on
plot(ca,sbxy)
hold off
to see that they are indeed curves.
Are you sure your calculations are correct?
David Hill
on 10 Apr 2020
And sbxy is not a line. Try plotting it all by itself (its amplitude is very small).
Rodrigo Blas
on 13 Apr 2020
Accepted Answer
More Answers (0)
Categories
Find more on 2-D and 3-D Plots in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!