A > B returns
a logical array with elements set to logical 1 (true)
where A is greater than B; otherwise,
the element is logical 0 (false).
The test compares only the real part of numeric arrays. gt returns
logical 0 (false) where A or B have
NaN or undefined categorical elements.

gt(A,B) is
an alternate way to execute A > B, but is rarely
used. It enables operator overloading for classes.

A — Left array scalar | vector | matrix | multidimensional array

Left array, specified as a scalar, vector, matrix, or multidimensional
array. Numeric or string inputs A and B must
either be the same size or have sizes that are compatible (for example, A is
an M-by-N matrix and B is
a scalar or 1-by-N row vector).
For more information, see Compatible Array Sizes for Basic Operations.

If A and B are categorical,
datetime, or duration arrays, then they must be the same size unless
one is a scalar.

If one input is an ordinal categorical array, the
other input can be an ordinal categorical array, a cell array of character
vectors, or a single character vector. A single character vector expands
into a cell array of character vectors of the same size as the other
input. If both inputs are ordinal categorical arrays, they must have
the same sets of categories, including their order. See Compare Categorical Array Elements for more details.

If one input is a datetime array, the other input
can be a datetime array, a character vector, or a cell array of character
vectors.

If one input is a duration array, the other input
can be a duration array or a numeric array. The operator treats each
numeric value as a number of standard 24-hour days.

If one input is a string array, the other input can
be a string array, a character vector, or a cell array of character
vectors. The corresponding elements of A and B are
compared lexicographically.

B — Right array scalar | vector | matrix | multidimensional array

Right array, specified as a scalar, vector, matrix, or multidimensional
array. Numeric or string inputs A and B must
either be the same size or have sizes that are compatible (for example, A is
an M-by-N matrix and B is
a scalar or 1-by-N row vector).
For more information, see Compatible Array Sizes for Basic Operations.

If A and B are categorical,
datetime, or duration arrays, then they must be the same size unless
one is a scalar.

If one input is an ordinal categorical array, the
other input can be an ordinal categorical array, a cell array of character
vectors, or a single character vector. A single character vector expands
into a cell array of character vectors of the same size as the other
input. If both inputs are ordinal categorical arrays, they must have
the same sets of categories, including their order. See Compare Categorical Array Elements for more details.

If one input is a datetime array, the other input
can be a datetime array, a character vector, or a cell array of character
vectors.

If one input is a duration array, the other input
can be a duration array or a numeric array. The operator treats each
numeric value as a number of standard 24-hour days.

If one input is a string array, the other input can
be a string array, a character vector, or a cell array of character
vectors. The corresponding elements of A and B are
compared lexicographically.