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?
조회 수: 2 (최근 30일)
이전 댓글 표시
댓글 수: 2
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
2022년 11월 2일
Suppose you have
A = [1 2 3; 4 5 6]
B = [7 8 9; 10 11 12]
size(A), size(B)
What are the ways you can arrange them?
C1 = cat(1, A, B), size(C1)
C2 = cat(2, A, B), size(C2)
C3 = cat(3, A, B), size(C3)
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
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
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{:});
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Creating and Concatenating Matrices에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!