# logical

Determine if symbolic equation, inequality, or condition is true

## Syntax

## Description

## Examples

## Input Arguments

## Tips

For symbolic equations,

`logical`

returns logical`1`

(`true`

) only if the left and right sides are equal. Otherwise, it returns logical`0`

(`false`

).For symbolic inequalities constructed with

`~=`

,`logical`

returns logical`0`

(`false`

) only if the left and right sides are equal. Otherwise, it returns logical`1`

(`true`

).For all other inequalities (constructed with

`<`

,`<=`

,`>`

, or`>=`

),`logical`

returns logical`1`

if it can prove that the inequality is true and logical`0`

if it can prove that the inequality is false. If`logical`

cannot determine whether an inequality is true or false, it returns an error.`logical`

does not simplify or mathematically transform a conditional statement. To compare a conditional statement applying mathematical transformations and simplifications, use`isAlways`

.If you use

`logical`

to check a conditional statement that involves a symbolic type, then the data types of the compared expressions must be compatible. For example,`logical(1==sym(1))`

returns`1`

(`true`

). If the expressions do not have compatible data types, then`logical`

returns an error. For example,`syms f(x) g(y); tf = logical(f~=g)`

returns an error.`logical`

ignores assumptions on symbolic variables.

## Version History

**Introduced in R2012a**