gt
Greater than, the function form of the operator >.
Category: Symbolic Computations in MATLAB > Operators and Elementary Operations
Syntax
C = gt(A, B)
Same as A > B.
Description
The operator A > B compares element by element and returns true where A is strictly greater. For complex numbers only the real parts are compared. A comparison involving NaN is false.
Sizes follow implicit expansion: a scalar is compared with every element of an array, and a row with a column produces a matrix.
Input arguments
A, B- Numeric, character or string arrays, or symbolic scalars. Sizes must be compatible (equal, or one is scalar, or broadcasting applies).
Output arguments
C- Logical array with the broadcast size. With symbolic operands, a symbolic relation such as
x > 1.
Example
Scalar against array
gt([1 5 3], 2)
gt(1, [0 1 2])
gt([1; 2], [1 2 3])
Output
ans = 1×3 logical array
0 1 1
ans = 1×3 logical array
1 0 0
ans = 2×3 logical array
0 0 0
1 0 0