and

Performs logical conjunction, the 'and' operation, equivalent to the & operator.

Syntax

and

and(x, y)

and(x, y, ...)

Inputs

x
Anything that can be logically tested.
Type: double | integer | char | logical | struct | cell
Dimension: scalar | vector | matrix
y
Anything that can be logically tested.
Type: double | integer | char | logical | struct | cell
Dimension: scalar | vector | matrix

Outputs

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

Examples

Multiple input example:
and(true,true,true,true,true)
R = 1
Matrix example:
and([true, true; false, false],[false, true; true,true])
ans = [Matrix] 2 x 2
0  1
0  0

Comments

The function returns true if both arguments are logically true, and false otherwise.

otherwise.