Function Switch

Syntax


y = fcnsw(p, x1, x2, x3)

Description


Returns x1, x2 or x3 depending on the value of the expression p, as follows:


y = x1                when p < 0.0

y = x2                when p = 0.0

y = x3                when p > 0.0


Example


y = fcnsw(cos(t), -1.0, 0.0, 1.0)