symtrue

Symbolic logical true.

Category: Symbolic Computations in MATLAB > Operators and Elementary Operations

Syntax

symtrue

Returns the symbolic constant true.

Description

symtrue is the symbolic counterpart of true. It is a sym object, not a logical value. It shows up as the condition of the catch-all branch in a piecewise expression, and as the result of symbolic comparisons that hold identically.

Use isAlways to turn a symbolic truth value into an ordinary logical.

Example

The constant in a piecewise default

syms x
symtrue
isAlways(symtrue)
piecewise(x < 0, -1, 0)
Output
ans = symtrue
ans = logical
   1
ans = piecewise(x < 0, -1, symtrue, 0)

See also

symfalse isAlways piecewise true