function B = nd22dcellwexdcell(A)
% N-D matrix to a 2-d cell whose entries are cells
% of dimension EXD, entries all scalar doubles.

% Copyright 2003-2004 The MathWorks, Inc.
szA = size(A);
exd = [szA(3:end) 1 1];
B = cell(szA(1),szA(2));
for i=1:szA(1)
   for j=1:szA(2)
      B{i,j} = num2cell(reshape(A(i,j,:),exd));
   end
end