piecewise
Conditionally defined expression or function
Syntax
Description
Examples
Input Arguments
Output Arguments
Tips
piecewise
does not check for overlapping or conflicting conditions. A piecewise expression returns the value of the first true condition and disregards any following overlapping true expressions. Thus,piecewise
follows the behavior of an if-else statement.In R2025a: You can use the
lhs
andrhs
functions to get the left and right sides of a symbolic equation that includes a piecewise expression.
Version History
Introduced in R2016b
See Also
and
| assume
| assumeAlso
| assumptions
| if
| in
| isAlways
| not
| or