From: Bruno Luong on
For such matrix, you might want to store in sparse format.

for i=1:10000
p{i}=sparse(i*eye(3));
end

A = blkdiag(p{:});

Bruno