我希望將兩個單元陣列連接在一起。我有兩個不同大小的矩陣,根據我的理解,將它們連接在一起的唯一可能方式是使用單元陣列。這裏是我的代碼連接單元陣列
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.
謝謝!我試圖在另一組數據上做類似的事情。只是做了一個小例子,它看起來很類似。 – 2013-02-28 14:04:25