&

Logical conjunction, the 'and' operator.

Syntax

a & b

Inputs

a
First logical argument.
Type: double | integer
Dimension: scalar | vector | matrix
b
Second logical argument.
Type: double | integer
Dimension: scalar | vector | matrix

Outputs

R
Logical test.

Examples

Tests if two arguments are true:

6 & 1
R = 1
Tests if a scalar and each element in a matrix are true:
6 & [1,2;3,4]
R  = [ 1 1 ; 1 1 ]

If at least one argument is false, then the statement returns false:

6 & false
R  = 0