||

Short circuit boolean 'or' operator.

Syntax

R = a || b

Inputs

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

Outputs

R
Scalar boolean evaluation of operand.

Example

a = 0;
b = 2;
R = a || b
R = 1

Comments

The expression following || is only executed if the preceding expression is false.