Info

此问题已关闭。 请重新打开它进行编辑或回答。

Can Anyone Solve this error?

1 次查看(过去 30 天)
Ahmed Saleem
Ahmed Saleem 2020-12-31
关闭: John D'Errico 2020-12-31
clc
% Part a
% ps1=exp (16.59158-(3643.31/(t-33.424)))
% ps2=exp (14.25326-(2665.54/(t-53.424)))
% T = 318.15 K and y1 = 0.60
t=318.15;
p=zeros(1,21);
syms y2 ps1 ps2 p x1 x2
for i=1:0.05:2
y1=i-1;
y2=1-y1;
k=round(((i-1+0.05)/0.05),0);
ps1 = exp (16.59158-(3643.31/(t-33.424)));
ps2 = exp (14.25326-(2665.54/(t-53.424)));
eqn1= p-((x1*ps1)+(x2*ps2))==0;
P(1,k)= vpa(solve(eqn1))
eqn2= x1-((y1*P(1,k))/ps1)==0;
X1(1,k)= vpa(solve(eqn2))
eqn3= x2-((y2*P(1,k))/ps2)==0;
X2(1,k)= vpa(solve(eqn3))
end
y1=0:0.05:1;
plot(y1,P,X1,P,'.-'), legend('y1vsP', 'X1vsP'),xlabel('x1,y1'), ylabel('P'), title('P vs xy Graph'),
grid on
Command Window:
Error using plot
Non-numeric data is not supported in 'Line'
Error in Examplethirteenpointone_b (line 24)
plot(y1,P,X1,P,'.-'), legend('y1vsP', 'X1vsP'),xlabel('x1,y1'), ylabel('P'), title('P vs xy Graph'),

回答(0 个)

此问题已关闭。

标签

Community Treasure Hunt

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

Start Hunting!

Translated by