Issue with "Matrix Dimensions Must Agree"

1 回表示 (過去 30 日間)
Kin Bezo
Kin Bezo 2019 年 4 月 15 日
コメント済み: Kin Bezo 2019 年 4 月 16 日
I get the "Matrix dimensions must agree." issue when I try to use this equation: heatTrans = r./((surfaceArea.^n).*(heatCap.^q)).
r is a 1x12 vector, surfaceArea is a 1x6 vector, heatCap is a 1x6 vector, and n and q are both 1x1 scalars. I can't seem to figure out where my issue is within the equation because I keep getting "Matrix dimensions must agree." despite using the dot operator.

採用された回答

Jon
Jon 2019 年 4 月 16 日
With the dimensions you indicate, it seems that the denominator will have 12 elements (you say r is 1 x 12) and the denominator only has 6 elements (it is the element by element product of two 1 x 6 vectors which will still be 1 x 6).
The problem is that even with the element by element operations (dot operator) the number of elements in the numerator and denominator must match.
  1 件のコメント
Kin Bezo
Kin Bezo 2019 年 4 月 16 日
Ah, thank you for the clarification.

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

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

製品


リリース

R2018b

Community Treasure Hunt

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

Start Hunting!

Translated by