How to combine several cell arrays into one cell array?

4 次查看(过去 30 天)
Hello every one,
I have 4 cell arrays as given below
H = 20*4*4 cell array
G = 40*8*4 cell array
Q = 20*4*8 cell array where Q(:,:, 1:4) are all zeros.
F = 40*8*8 cell array where F(:,:,1:4) are all zeros.
I want to put all these cells in one 40*8*8 cell arrays, called C, such that the
C(1:20, 1:4 ,1:4) = H
C(21:40, 5:8, 1:4) = G(21:40, 5:8, 1:4)
C(1:20, 1:4, 5:8) = Q(1:20, 1:4, 5:8)
C(21:40, 5:8, 5:8) = F(21:40, 5:8, 5:8)
Any idea how can I do that?Thanks in advance!
  2 个评论
Walter Roberson
Walter Roberson 2021-2-8
C(1:20, 1:4 ,1:4) = H;
C(21:40, 5:8, 1:4) = G(21:40, 5:8, 1:4);
C(1:20, 1:4, 5:8) = Q(1:20, 1:4, 5:8);
C(21:40, 5:8, 5:8) = F(21:40, 5:8, 5:8);
looks plausible. What difficulty did you encounter?
Susan
Susan 2021-2-8
Thanks for your response. Just wanted to make sure that it makes sense.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Creating and Concatenating Matrices 的更多信息

Community Treasure Hunt

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

Start Hunting!

Translated by