function z = le(x, y)
%<=   Less than or equal.
%   Z = X <= Y
%   Z = LE(X,Y)
%   
%   If X and Y are both formatted dlarrays, Z is formatted with a
%   combination of both of their data formats. The function uses implicit
%   expansion to combine X and Y. Singleton dimensions (dimensions of size
%   1) with dimension labels are introduced into X and Y as necessary to
%   make their data formats match. Singleton dimensions are inserted at the
%   end of each block of dimensions with the same label.
%
%   Example:
%   X has format 'SCB'
%   Y has format 'SSCT'
%
%   X: |S |C|B| |
%   Y: |SS|C| |T|
%   Z: |SS|C|B|T|
%   
%   Output Z has format 'SSCBT'.
%
%   See also LE, DLARRAY.

%   Copyright 2019-2023 The MathWorks, Inc.

% If this file is modified to not be a standard binary element-wise
% broadcast function, please also remove the following template tags.
%!define $BinaryFunction $xdata <= $ydata
%!template $BinaryBroadcastTemplate
% Code generated and inserted by deep.dev.generateDlarrayMethods.

% Extract data to work on and create a template output object.  If either
% of the inputs are reusable it will be used as the template output.
[z, fdz, xdata, ydata] = extractBinaryBroadcastData(...
    matlab.lang.internal.move(x), ...
    matlab.lang.internal.move(y));

zdata = matlab.lang.internal.move(xdata) <= matlab.lang.internal.move(ydata);

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