lognum
Numeric coercion of a logical value.
Syntax
Section titled “Syntax”B = lognum(A)Description
Section titled “Description”Converts logical values to their numeric equivalents — true becomes 1, false becomes 0. Element-wise. Same effect as double(A) for logical inputs.
Example
Section titled “Example”lognum([true false true]) % [1 0 1]