why do ı receive the error "data must be numeric, datetime, duration, or an array convertible to double". How can I fix it?

R=8.314;
T=298:10:450
Prxn=1:1:5
for j=1:size(Prxn,2)
syms x
Ka=exp(((46.1)./(R.*T)+0.0993./R));
Kaa=(((2.*x).^2.*(4-2.*x).^2)./((1-x).*(3-3.*x).^3.*(Prxn(j)).^2))-Ka==0;
extent=solve(Kaa,x);
plot(T,extent);
hold on;
end

 採用された回答

Rik
Rik 2021 年 6 月 16 日
Extent is still a symbolic by the time you try to plot it. You need to convert it to a double. Since you omitted the definition of T we can't test your code.

2 件のコメント

I want to test the code for T interval of 298-450 K for different P values. But I couldnt know how to write it. By the way thanks for your answer:)
Rik
Rik 2021 年 6 月 17 日
I can't tell from your comment if the problem is solved. If so, please consider marking my answer as accepted. If not, feel free to comment with your remaining issues.

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

その他の回答 (0 件)

カテゴリ

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

質問済み:

2021 年 6 月 16 日

コメント済み:

Rik
2021 年 6 月 17 日

Community Treasure Hunt

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

Start Hunting!

Translated by