Inner matrix dimensions must agree

1 回表示 (過去 30 日間)
b.m.n n
b.m.n n 2016 年 11 月 14 日
コメント済み: Alexandra Harkai 2016 年 11 月 16 日
Dear All Can anyone help me about this equation Qb=Qba*(1-(0.3251).^2)+4*(0.985)*(5.67*10.^-8)*(TS).^3*(TT); When i run it , I get this error Error using * Inner matrix dimensions must agree. where Qba [37*37 double] TS[37*1 double] TT [37*31 double] Thank All

回答 (2 件)

Jan
Jan 2016 年 11 月 14 日
As you see, you want to multiply a [71x1] vector with a [37x31] matrix. This is mathematically not defined. What do you expect as output?
  3 件のコメント
Jan
Jan 2016 年 11 月 15 日
Of course it shows the same error for a [37x1] and [73x1] matrix. A valid Matrix multiplication would be: [1x37] and [37x1]. Please ask e.g. WikiPedia for the term "matrix multiplication".
b.m.n n
b.m.n n 2016 年 11 月 16 日
Thank you so much Jan Simon

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


Alexandra Harkai
Alexandra Harkai 2016 年 11 月 14 日
4*(0.985)*(5.67*10.^-8)*(TS).^3*(TT)
Here according to the operator precedence this happens:
(some_constant * (TS.^3)) * TT
which would require a matrix of 37x1 to be multiplied by a matrix of size 37x31, which is giving you the error.
It is possible the calculation is not formulated correctly in the first place.
  6 件のコメント
b.m.n n
b.m.n n 2016 年 11 月 16 日
Thank you so much..Alexandra ..I want to get same size for TA and TS .But i don't now how .
Alexandra Harkai
Alexandra Harkai 2016 年 11 月 16 日
It is not exactly clear what you are tying to achieve. Depending on what the vectors represent, the operation may not even make sense. Are you sure this is the computation you need?

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

カテゴリ

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

Community Treasure Hunt

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

Start Hunting!

Translated by