在 matlab 中,我有一个 4x5 元胞数组,其中每个元胞由一个 121x1 向量组成。
创建 3 维 4x5x121 矩阵避免 2 重循环的最简单方法是什么。
最佳答案
一种方式(不一定是最快的)
%# convert all arrays in the cell array inCell to 1x1x121
permCell = cellfun(@(x)permute(x,[3,2,1]),inCell,'uniformOutput',false);
%# catenate
array = cell2mat(permCell);
关于matlab - 在 matlab 中连接元胞数组的向量,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13008730/