ifelse (Series)
Replace time series values based on a test condition
Syntax
X = ifelse(X, Test, IfTrue, ~IfFalse)
Input arguments marked with a
~sign may be omitted.
Input arguments
X [ TimeSubscriptable ]
Input time series.
Test [ function_handle ]
Test function that returns
trueorfalsefor each observation.
IfTrue [ any | empty ]
Value assigned to observations for which the
Testfunction returnstrue; if isempty, these observations will remain unchanged.
IfFalse [ any | empty ]
Value assigned to observations for which the
Testfunction returnsfalse; if isempty or omitted, these observations will remain unchanged.
Output arguments
X [ TimeSubscriptable ]
Output time series.
Options
zzz=default [ zzz | ___ ]
Description
Description
Examples