function z = uminus(z)
%-  Unary minus.
%   Y = -X
%   Y = UMINUS(X)
%
%   The output Y has the same data format, if any, as the input X.
%
%   See also UMINUS, DLARRAY.

%   Copyright 2019-2023 The MathWorks, Inc.

%!define $UnaryFunction -$zdata
%!template $UnaryElementWiseTemplate
% Code generated and inserted by deep.dev.generateDlarrayMethods.

% Extract data to work on and create a template output object.
[z, fdz, zdata] = extractUnaryElwiseData(z);

zdata = -matlab.lang.internal.move(zdata);

z = restoreUnaryElwiseData(z, ...
    matlab.lang.internal.move(fdz), ...
    matlab.lang.internal.move(zdata));
%!template
end
