我正在尝试填充 3D 单元格数组。这是代码:
D = cell(M,N,1);
for i = 1:M
for j=1:N
for k = 1:L
D{i}{j}(1+length(D{i}{j})) = 1; % error here
end
end
end
Cell contents reference from a non-cell array object
即使命令窗口中的以下内容正常工作,我也会收到错误消息:
D{i}{j}(1+length(D{i}{j})) = 1;