obtaining a wrong matrix size

10 ビュー (過去 30 日間)
Josep
Josep 2014 年 8 月 22 日
コメント済み: Star Strider 2014 年 8 月 22 日
I would like to know why I am obtaining as a result in this code, a matrix (15x1) and not a number. I am computing a test statistics equation that involves matrices products, so I am multiplying this matrix sizes:
((1x15)*(15x15)*(15x1))X((1x15)*(15x15)*(15x1))^2
I guess I am supposed to achieve a number, from this matrices products, but as I have said, MATLAB returns me as a solution of this equation a 15x1 matrix. Otherwise, at the end I have put the command size(T), to know the matrix size of T, and it returns me that is a 1x1 matrix (a number). Does anybody know why this two things doesn't match?
Following, here is my MATLAB code attached if you want to take a look at it
  1 件のコメント
Image Analyst
Image Analyst 2014 年 8 月 22 日
The attached code also requires .xlsx workbooks, which were not attached. Attach the workbooks if you want us to try the code.

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

採用された回答

Star Strider
Star Strider 2014 年 8 月 22 日
It is difficult to read your code and I can’t run it. I ran a simulation of the matrix operation you describe, and got a scalar result as expected.
I suggest you check the sizes of the matrices in your equation. One of your vectors may actually be a matrix.
  9 件のコメント
Josep
Josep 2014 年 8 月 22 日
Nice!
Thanks Star Strider one more time
Star Strider
Star Strider 2014 年 8 月 22 日
My pleasure!

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

その他の回答 (0 件)

カテゴリ

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