Code :
---------------------------------
T= 323.15;
A1= 4.01814;
B1= 1203.835;
C1= -53.226;
A2= 4.08245;
B2= 1346.382;
C2= -53.508;
Psat1= 10^(A1-(B1/(T+C1)));
Psat2= 10^(A2-(B2/(T+C2)));
x= [0:0.05:1]
y= ((Psat1)*(x))/((x)*(Psat1)+(1.-x)*(Psat2))
plot(x,y,'r+')
----------------------------------------
I want to plot the relationship between x and y. Although y is an expression for x, this code holds y at one value. I want to know what is the problem, and how to change the code to operate it as I intended.

 採用された回答

madhan ravi
madhan ravi 2018 年 11 月 4 日

0 投票

T= 323.15;
A1= 4.01814;
B1= 1203.835;
C1= -53.226;
A2= 4.08245;
B2= 1346.382;
C2= -53.508;
Psat1= 10^(A1-(B1/(T+C1)));
Psat2= 10^(A2-(B2/(T+C2)));
x= [0:0.05:1]
y= ((Psat1).*(x))./((x).*(Psat1)+(1.-x).*(Psat2))
plot(x,y,'r+')

5 件のコメント

madhan ravi
madhan ravi 2018 年 11 月 4 日
編集済み: madhan ravi 2018 年 11 月 4 日
use element-wise operation that is put .* and ./ instead of * and /
MeOB
MeOB 2018 年 11 月 4 日
Wow, thank you for your help!
You are my hero!
madhan ravi
madhan ravi 2018 年 11 月 4 日
編集済み: madhan ravi 2018 年 11 月 4 日
Anytime :)
Rahul k
Rahul k 2018 年 11 月 4 日
i did, can u help me with the solution please?I m new here, will knoe how to get started and make queries soon.
madhan ravi
madhan ravi 2018 年 11 月 4 日
get back to your original question

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

ヘルプ センター および File ExchangeMATLAB についてさらに検索

製品

リリース

R2018b

タグ

質問済み:

2018 年 11 月 4 日

コメント済み:

2018 年 11 月 4 日

Community Treasure Hunt

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

Start Hunting!

Translated by