How to arrange stacked Images into a 2 dimension array?
1 次查看(过去 30 天)
显示 更早的评论
I have a stack of 40 Images with dimension of 1000*1000 as:
Images<1000*1000*40 double>
I want to arrange the Images as shown below in a single array of size 8000*5000:
Can anyone help?
1 个评论
采纳的回答
David Young
2015-6-7
编辑:David Young
2015-6-7
Images2d = reshape( ...
permute( ...
reshape(Images, 1000, 1000, 8, 5), ...
[1 3 2 4]), ...
8000, 5000);
0 个评论
更多回答(1 个)
Walter Roberson
2015-6-7
You can mat2cell splitting along the 3rd dimension, reshape the cell array 8x5 and then cell2mat back
1 个评论
Walter Roberson
2015-6-7
Sz = size(Image4D);
T = mat2cell(Image4D, Sz(1), Sz(2), Sz(3), ones(1,Sz(4));
Image3D = cell2mat(reshape(T, 8, 5));
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Resizing and Reshaping Matrices 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!