function x = identity(x)
%IDENTITY Apply IDENTITY transformation to input variable
%   Y = IDENTITY(X) returns a new variable Y from X that is equal to X

%   Copyright 2022 The MathWorks, Inc.

fd = x.FormattedData;
x.FormattedData = [];
[fd, z] = extractData(fd);

if isa(z,'deep.internal.recording.RecordingArray')
    z = identity(z);
end

% Format is guaranteed not to have changed
fd = insertData(fd, z);
x.FormattedData = fd;
end
