Multiply a 3D matrix with 2d matrix to get a vector

5 ビュー (過去 30 日間)
Shashank
Shashank 2014 年 7 月 2 日
コメント済み: Shashank 2014 年 7 月 2 日
Suppose:
  • X is a 3x3x6 matrix.
  • Y is a 3x3 matrix
  • Z is a 6x1 matrix
  • Y(ij) = X(ijk) * Z(k) ....(i,j=1,3 and k=1,6) as per Einstein's notation
Y and Z are known. How to obtain X ...

回答 (1 件)

David Sanchez
David Sanchez 2014 年 7 月 2 日
The only solution that suits the dimensions of the matrices is this:
Y = rand(3);% Y is a 3x3 matrix
Z = rand(6,1);% Z is a 6x1 matrix
X = zeros(6,3,3); % % X is a 6x3x3 matrix.
for k=1:6
X(k,:,:) = Y/Z(k);
end
  1 件のコメント
Shashank
Shashank 2014 年 7 月 2 日
Thanks for your reply...It appears that, I wrote the wrong dimensions for matrix X...X(3x3x6) matrix....Apologies for that..

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

カテゴリ

Help Center および File ExchangeArithmetic Operations についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by