nozc
Parent Section: equations
Syntax
nozc(expression) nozc(expression,ignoreZC)
Description
The nozc operator removes zero crossings from Simscape™ Language expressions. Use this operator on continuous and smooth
expressions to remove zero crossings added by functions, relational operators, and
operators, such as mod, >, or
and. If you use the operator on a discontinuous expression, or an
expression where the derivative changes abruptly, the simulation may have issues with
accuracy or convergence. For a list of functions that can generate zero crossings, see
equations.
To toggle the removal of zero crossings, you can optionally include a second operand.
nozc(expression,ignoreZC) removes zero crossings from the
expression when the Boolean ignoreZC is true,
which is the default behavior. When ignoreZC is
false, the operator does nothing and does not remove the zero
crossings.
Assumptions and Limitations
Using
nozcin event predicates does not remove zero crossings. For example, this expression creates a zero crossing whenxbecomes greater than or equal to 1.events when edge(nozc(x >= 1)) d = d + 1; end endFor more information about event predicates, see Discrete Event Modeling.
When you use
nozcon a function that converts data types, the expression may include zero crossings. For example, this expression creates a zero crossing every time the converted integer changes value.x1 == nozc(int32(x2));
Examples
Version History
Introduced in R2026a