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-2020 The MathWorks, Inc.

%#define $UnaryFunction -$zdata
%#template $UnaryElementWiseTemplate
% Template inserted by deep.dev.generateDlarrayMethods, 2020-02-26 14:14 

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

zdata = -zdata;

z = restoreUnaryElwiseData(z, ...
    matlab.lang.internal.move(fdz), ...
    matlab.lang.internal.move(zdata));

%#template
end
