~

Logical negation, the 'not' operator.

Syntax

R = ~A

Inputs

A
A variable that can be converted to a logical 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

Example

Matrix example.

R = ~[7 0 2]
R = [Matrix] 1 x 3
0  1  0