how do you create an array of 3d arrays
28 次查看(过去 30 天)
显示 更早的评论
I have a stack of images that are organized by row x column x images in stack to form a 3d array e.g. 10x 10 x 100. This would be 100 frame stack of 10 x 10 images. I need to create an array of them. For example 10 x 10 x 100 x 15 would be 15 image stacks where there are 100 10x10 images in each stack. I've been trying different ways of using the cat function but without any luck.
0 个评论
回答(2 个)
Matt J
2021-10-15
编辑:Matt J
2021-10-15
I've been trying different ways of using the cat function
You haven't told us in what form the 15 stacks exist now. If you have the stacks as 15 separate variables currently in your workspace then the cat() function is indeed the thing to use, e.g.,
A=cat(4, stack1,stack2,...,stack15)
If you expect to generate these stacks over the course of the loop, you could just pre-allocate the 4D array that will hold them.
A=nan(10,10,100,15);
for i=1:15
A(:,:,:,i)=... %compute something
end
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Logical 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!