transform a 3d matrix into cell array

28 次查看(过去 30 天)
hello I would like to transform m by n by k matrix into cell array as k by 1 where each cell contain m by n matrix, how can I do it ?? I have tried the following code but I get a 1X1 cell
Mycell= mat2cell(Mymatrix, m , n,ones(k,1));

采纳的回答

Andrei Bobrov
Andrei Bobrov 2017-6-9
编辑:Andrei Bobrov 2017-6-9
Mycell = num2cell(Mymatrix,[1 2])
or
Mycell = squeeze(num2cell(Mymatrix,[1 2]))

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Multidimensional Arrays 的更多信息

标签

Community Treasure Hunt

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

Start Hunting!

Translated by