I have a matrix W of 361*285.I want to create a matrix such that each column(1*285) of the matrix is reshaped into a matrix of (19*19)(read as atom)such that the atoms are concatenated into a 19*15 matrix

2 ビュー (過去 30 日間)

採用された回答

KL
KL 2017 年 9 月 11 日
A = rand(361,285);
B = reshape(A,19,19,19,15);
  3 件のコメント
kitty varghese
kitty varghese 2017 年 9 月 12 日
@KL how can i multiply f=randn(20,50) to B?
KL
KL 2017 年 9 月 12 日
編集済み: KL 2017 年 9 月 12 日
You could index B depending on your needs. For example,
>> B(:,:,1,1)
would be 19x19 matrix (this is your atom I guess). There are 19x15 such atoms (from B(:,:,1,1) to B(:,:,19,15)).
Next, I don't understand what you mean by multiply 20x50 matrix to B? As I explained before, you should treat ND-matrix as a matrix of matrices.

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

その他の回答 (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