Problems with matrix dividing

5 ビュー (過去 30 日間)
Lisa
Lisa 2012 年 11 月 26 日
I want to create a matrix (arrow) and use an arrow and several constants. The error code tells me that matrix dimensions must agree (which I know). How do I get by the problem without making my constants into arrows?
This is my code:
T=[23.1 22.5]; TK=T+273.15;
% Antoine's eqn: logP=A-B/(T+C) Aa=7.24208; Ba=1210.595; Ca=229.664; Aw=8.19625; Bw=1730.630; Cw=233.426;
Pa=10^(Aa-Ba/(T+Ca)) Pw=10^(Aw-Bw/(T+Cw))
  1 件のコメント
Jan
Jan 2012 年 11 月 26 日
If you mention an "error code", it is most likely very helpful, if you post the complete error message also. Then we do not have to guess the problem, but we can concentrate on the solution. Thanks.

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

回答 (2 件)

Daniel Shub
Daniel Shub 2012 年 11 月 26 日
I have no idea what you are trying to do ...
Do you want to do element wise operations? There is a difference between ^ and .^ and / and ./
Pa=10.^(Aa-Ba./(T+Ca))
Pw=10.^(Aw-Bw./(T+Cw))

Image Analyst
Image Analyst 2012 年 11 月 26 日
You have T as two numbers:
T=[23.1 22.5];
Try the equation with T being just one number at a time. Or else make all the other numbers 1 by 2 arrays as well, and use ./ instead of /.

カテゴリ

Help Center および File ExchangeCreating and Concatenating Matrices についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by