- `logical (X)`

Convierte el objeto numérico `X` a tipo lógico.

Cualquier valor distinto de cero se convertirá en verdadero (1), mientras que
los valores cero se convertirán en falso (0). El valor no numérico NaN no se
puede convertir y producirá un error.

Nota de compatibilidad: MthJSLab acepta valores complejos como entrada,
mientras que
[MATLAB&reg;](https://www.mathworks.com/)/[Octave](https://www.gnu.org/software/octave/)
salidas un error.

Véase también: `char`.

### Referencias

- https://www.mathworks.com/help/matlab/ref/logical.html
- https://octave.sourceforge.io/octave/function/logical.html
- https://mathworld.wolfram.com/BooleanAlgebra.html
- https://mathworld.wolfram.com/BinaryOperation.html
- https://mathworld.wolfram.com/BinaryOperator.html
- https://mathworld.wolfram.com/TruthTable.html
- https://es.wikipedia.org/wiki/Valor_de_verdad
