valueChanged#

swordfish.function.valueChanged()#

Compare each element in X with the element specified by mode. Return true if the value is changed, otherwise false. Return false if the compared object does not exist.

For example, for the first element of valueChanged(X, [mode=”prev”]) and the last element of valueChanged(X, [mode=”next”]), the function returns false.

If X is a matrix/table, perform the aforementioned operation on each column and return a matrix/table.

Parameters:
  • X (Constant) – A vector/matrix/table/tuple of STRING, BOOL, temporal or numeric type.

  • mode (Constant, optional) –

    A string, by default DFLT. It can take the value of “prev”, “next”, “either” and “both”.

    • ”prev”: the previous element

    • ”next”: the next element

    • ”either”: the previous OR the next element

    • ”both”: the previous AND the next element