我試圖在二維單元陣列行末尾添加一個元素。我的代碼是:在二維單元陣列中追加八度數
b = cell(5, 0)
b(1) = {b(1, :), 2} % Trying to append at the end of the first row
這給我的錯誤:error: A(I) = X: X must have the same size as I
我也嘗試過各種其他形式,如:
b = cell(5, 0)
b(1, end+1) = 2 % Ok, inserts 2 at [1,1]
b(2, end+1) = 3 % No, inserts 3 at [2,2] instead of [2, 1]
何必'B(2,終端+ 1)= 3'插入'3'在'[1]'? – Shai 2013-05-12 08:36:08
對不起,我的意思是'[2 1]' – 2013-05-12 08:41:55