フィルターのクリア

Concatenate 2D matrices into one 3D matrix with for loop

2 ビュー (過去 30 日間)
Johanna Popp
Johanna Popp 2021 年 6 月 16 日
コメント済み: Stephen23 2021 年 6 月 16 日
I have a structure containing 557 376 x 376 double matrices. How do I concatenate the 2D matrices to create a 3D matrix with the size 376 x 376 x 557?
  2 件のコメント
Johanna Popp
Johanna Popp 2021 年 6 月 16 日
I tried this, but didn't seem to work:
data_cell = struct2cell(data)
% convert structure into cell to be able to access individual matrices
% Individual matrices are accessed as follows: matrix_n = data_cell{n,1}.matrix
for k = 1:557
data_3D_matrix = cat(k,data_cell{k,1}.matrix)
end
Stephen23
Stephen23 2021 年 6 月 16 日
"Concatenate 2D matrices into one 3D matrix with for loop"
Is there a particular requirement to use a FOR loop?

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

回答 (1 件)

Stephen23
Stephen23 2021 年 6 月 16 日
編集済み: Stephen23 2021 年 6 月 16 日
  2 件のコメント
Johanna Popp
Johanna Popp 2021 年 6 月 16 日
Thanks! But now I'm getting a structure with the dimensions 1x1x557 that has the string 'matrix' in it and not the actual 376x376 matrix of values...
Stephen23
Stephen23 2021 年 6 月 16 日
Please upload your actual data by clicking the paperclip button.

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

カテゴリ

Help Center および File ExchangeData Type Identification についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by