function L = getLocalPart(D)
%getLocalPart Get local portion of a codistributed array
%   L = getLocalPart(D) returns the local portion of a codistributed array D.
%   The format of the local part depends on the distribution scheme of D.
%   
%   Example:
%   spmd
%     % With spmdSize = 4
%     D = eye(4, codistributor1d(1))
%     L = getLocalPart(D)
%   end
%   
%     returns
%   
%     Worker 1: L = [1 0 0 0]
%     Worker 2: L = [0 1 0 0]
%     Worker 3: L = [0 0 1 0]
%     Worker 4: L = [0 0 0 1]
%   
%   See also CODISTRIBUTED/GETCODISTRIBUTOR, CODISTRIBUTOR, CODISTRIBUTOR1D, 
%   CODISTRIBUTOR2DBC, CODISTRIBUTED/GLOBALINDICES.


%   Copyright 2006-2022 The MathWorks, Inc.

L = D.Local;
