%% Square Sparse Identity Matrix
% Create a 1000-by-1000 square sparse identity matrix and view the sparsity pattern.

I = speye(1000);
spy(I)

% The result is the same as sparse(eye(1000)), but this latter version requires temporary storage for the full representation before it is converted to sparse storage.
% Copyright 2019 The MathWorks, Inc.