function [x,XShape] = internal_reshape(x,varargin)
% This function is undocumented and will change in a future release.

%   Copyright 2023 The MathWorks, Inc.

if (nargout > 1)
    XShape = size(x);
    x = reshape(x,varargin{:});
else
    x = reshape(x,varargin{:});
end
end