我希望将两个单元格数组连接起来。我有两个大小不同的矩阵,从我的理解来看,唯一可能将它们连接在一起的方法是使用单元格数组。以下是我的代码:
M = magic(3);
B = {magic(3) 'sip' magic(4) magic(3) }
C = {B; ...
B; ...
B; ...
B}
c1 = C{1}{1,1};
c2 = C{1}{1,3};
c{1} = c1; % after extracting matrix from cell array put it it
c{2} = c2; % into another cell array to attempt to concatenate
conca = [c{1};c{2}]; %returns error.
我遇到了以下错误:
??? Error using ==> vertcat
CAT arguments dimensions are not
consistent.
Error in ==> importdata at 26
conca = [c{1};c{2}]; %returns error.