ifirstHit#

swordfish.function.ifirstHit()#

Return the index of the first element in X that satisfies the condition X func target (e.g. X>5).

If no element in X satisfies the condition, return -1.

Null values are ignored in ifirstHit.

  • Use ifirstNot to find the index of the first non-null value.

  • Use find to find the index of the first null value.

Parameters:
  • func (Constant) – Can only be the following operators: >, >=, <, <=, !=, <>, ==.

  • X (Constant) – A vector/matrix/table.

  • target (Constant) – A scalar of the same type as X indicating the value to be compared with X.