i have arrays of size 234X64X8, 234X64X8,234X64X8 and 234X64X8 inside a cell of size 4X1. i want it to be a shape of 936X256X32 as a 1X1 cell. how to do?

1 回表示 (過去 30 日間)
  2 件のコメント
KSSV
KSSV 2022 年 11 月 2 日
936X256X32 or 234X64X8X32 ?
Image Analyst
Image Analyst 2022 年 11 月 2 日
Please attach your cell array so we can try using repmat() to replicate your image into a 4x4 array.

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

回答 (2 件)

Walter Roberson
Walter Roberson 2022 年 11 月 2 日
Suppose you have
A = [1 2 3; 4 5 6]
A = 2×3
1 2 3 4 5 6
B = [7 8 9; 10 11 12]
B = 2×3
7 8 9 10 11 12
size(A), size(B)
ans = 1×2
2 3
ans = 1×2
2 3
What are the ways you can arrange them?
C1 = cat(1, A, B), size(C1)
C1 = 4×3
1 2 3 4 5 6 7 8 9 10 11 12
ans = 1×2
4 3
C2 = cat(2, A, B), size(C2)
C2 = 2×6
1 2 3 7 8 9 4 5 6 10 11 12
ans = 1×2
2 6
C3 = cat(3, A, B), size(C3)
C3 =
C3(:,:,1) = 1 2 3 4 5 6 C3(:,:,2) = 7 8 9 10 11 12
ans = 1×3
2 3 2
So when you concatenate them together, the dimension you concatenate along becomes the sum of the input sizes in that dimension, and the remaining dimensions remain the length they were. Putting together two 2 x 3 arrays does not give you a 4 x 6 array -- at least not normally.
You can deliberately code concatenating them together repeatedly, using multiple copies of the input to produce something that is larger in each dimension -- but is that really what you want to do?
  2 件のコメント
ANUSAYA SWAIN
ANUSAYA SWAIN 2022 年 11 月 2 日
I want 4 arrays of size 234X64X8 to be of size 936X256X32. Is it possible to do so. like I am saying after concatenating all the 4 arrays the size should be (234x4=936),(64X4=256),(8X4=32)
Walter Roberson
Walter Roberson 2022 年 11 月 2 日
It is certainly possible to do, but we need you to confirm that it is acceptable that there will be 16 copies of each array.
big_array = cell2mat(repmat(hDp, 1, 4, 4) );

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


Maik
Maik 2022 年 11 月 2 日
編集済み: Maik 2022 年 11 月 2 日
% Code for Cell Concatenation - Input Size(234x64x8)
Arr = ones(234,64,8);
cellArr = {Arr, Arr, Arr, Arr}';
% Concatenation Across Row Dimension - Size (934x64x8)
cellRowCat = cat(1,cellArr{:});
% Concatenation Across Column Dimension - Size (234x256x8)
cellColCat = cat(2,cellArr{:});

カテゴリ

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