Matrix maths within an elementwise calculation.

1 回表示 (過去 30 日間)
Craig Tollerton
Craig Tollerton 2016 年 6 月 15 日
コメント済み: KSSV 2016 年 6 月 15 日
Hi all, So my problem is I want to create two matrices for example
M1 = [a b
c d]
M2 = [e f
g h]
and all the elements are 2-component spinors e.g.
a = [s p].
Then I want to perform an elementwise calculation of the matrices (I understand .*) but need to apply matrix multiplication between the elements. So I want the following result matrix;
[a.e b.f
c.g d.h].
(More specifically there will be a transformation in between such that I actually want a*^T.[0 1;1 0].e, but I don't this this will change the solution. Any help would be greatly appreciated.
Craig

回答 (1 件)

KSSV
KSSV 2016 年 6 月 15 日
For multiplication you have to use M1.*M2...and for the other part you have to be bit more clear...
  2 件のコメント
Craig Tollerton
Craig Tollerton 2016 年 6 月 15 日
the second part is the difficulty I am having. Each element of the original matrices I need to be 2x1 matrices themselves. When they multiply it needs to be by standard matrix algebra not elementwise.
KSSV
KSSV 2016 年 6 月 15 日
not clear.......

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

カテゴリ

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