or

Performs logical disjunction, the 'or' operation, equivalent to the | operator.

Syntax

R = or(A, B)

Inputs

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

Outputs

R
Resulting evaluation.
Type: logical

Example

Simple or example.

a = true;
b = false;
R = or(a, b)
R = 1

Comments

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