Creating a 3D array from multiple 2D arrays

How can I create a 3D matrix from 124 slices of 2D 256 x 256 matrices? I want to combine these to form a 256 x 256 x 124 matrix. How do I do this using a loop? Thanks!!

댓글 수: 3

What do you mean by 'slices'? How did you obtain the 124 'slices'?
They're all different uint8 scans of a 256x256 MRI scan. I need to combine them into a 3D matrix. Thanks!
Stephen23
Stephen23 2017년 2월 14일
편집: Stephen23 2017년 2월 14일
@George Rawlinson: load your data into one cell array, or simply preallocate the whole ND array and load directly into that, as this forum and the documentation already explain:
Do not load into lots of variables in the workspace, because this makes accessing them slow and buggy:

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 Matrix Indexing에 대해 자세히 알아보기

질문:

2017년 2월 14일

편집:

2017년 2월 14일

Community Treasure Hunt

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

Start Hunting!

Translated by