Real Switch

Syntax


y = rsw(p, x1, x2)

Description


Returns either x1 or x2 (double precision values) depending on the value of the argument p (which may be an expression evaluating to a double precision value):


y = x1                when p is TRUE

y = x2                otherwise

Example


y = lsw(t > 5.0, -1.0, 2*t)