poster
2019-12-14, 20:13
表达式是:
for i=1:n X(:,i) = [P{i}(:)]; end 其中X是DxN矩阵,P是单元数组。
回答:
如果通过mat2cell获得了单元阵列,则可能需要将图像的块排列到阵列X的列中。可以使用命令IM2COL (http://www.mathworks.com/help/toolbox/images/ref/im2col.html)在一个步骤中完成此操作 (http://www.mathworks.com/help/toolbox/images/ref/im2col.html)
%# rearrange the large array so that each column of X %# corresponds to the 4 pixels of each 2-by-2 block X = im2col(largeArray,[2 2],'distinct');
更多&回答... (https://stackoverflow.com/questions/5213424)
for i=1:n X(:,i) = [P{i}(:)]; end 其中X是DxN矩阵,P是单元数组。
回答:
如果通过mat2cell获得了单元阵列,则可能需要将图像的块排列到阵列X的列中。可以使用命令IM2COL (http://www.mathworks.com/help/toolbox/images/ref/im2col.html)在一个步骤中完成此操作 (http://www.mathworks.com/help/toolbox/images/ref/im2col.html)
%# rearrange the large array so that each column of X %# corresponds to the 4 pixels of each 2-by-2 block X = im2col(largeArray,[2 2],'distinct');
更多&回答... (https://stackoverflow.com/questions/5213424)