%% Sparse Identity Matrix
% Define a 5-by-5 sparse matrix.

p = sparse(5,5,pi);

%
% Create a 5-by-5 identity matrix that is sparse like P.

I = eye(5,'like',p)

% Copyright 2012 The MathWorks, Inc.