matlab - Convert 3D array to cell of 2D arrays -
i use octave, matlab users helpful.
i have an array defined in space m x n
, in time, t
. therefore has size m x n x t
. function, more helpful convert 3d dimension cell following structure:
consider a
m x n x t
array.
cell = {a(:,:,1), a(:,:,2), ..., a(:,:,t)}
, has t
element, each element m x n
array.
i don't know how dynamic t
.
you can use mat2cell
achieve it:
[m n t] = size(a); b=mat2cell(a, m, n, ones(1,t));
Comments
Post a Comment