|

Logical disjunction, the 'or' operator.

Syntax

R = A | B

Inputs

A
Anything that can be converted to a boolean value.
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | string | vector | matrix
B
Anything that can be converted to a boolean value.
Type: double | integer | char | string | logical | struct | cell
Dimension: scalar | string | vector | matrix

Outputs

R
Numerical representation of true or false (1 or 0).
Type: logical

Examples

Two value example:
a = true;
b = false;
R = a | b
R = 1
Matrix example:
a = [true, false; false, true];
b = [false, false; true, true];
R = a | b
R = [Matrix] 2 x 2
1  0
1  1

Comments

The operator returns true if either argument is logically true, and false otherwise.