function localParts = pagefunGetLocalParts(inputMatrices)
% Helper returning the local parts of the codistributed inputs and the
% replicated inputs.

%   Copyright 2020 The MathWorks, Inc.

localParts = cellfun(@iGetLocalPart, inputMatrices, 'UniformOutput', false);
end

% Extract the local part or replicated array.
function arg = iGetLocalPart(arg)
if iscodistributed(arg)
    arg = getLocalPart(arg);
end
end
