isPeak#

swordfish.function.isPeak()#

If X is a vector, check if each element in X is the peak.

If X is a matrix, perform the aforementioned calculations on each column and return a matrix of the same size as X.

If X is a table, only the numeric columns are involved in the calculations.

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

  • strict (Constant) –

    A Boolean value. For a segment of continuous identical numbers forming a local maximum (referred to as a plateau), the value of strict determines whether the entire plateau is considered a peak.

    • When strict = true, the plateau is not considered a peak, meaning all elements in the plateau return false.

    • When strict = false,

      • If the number of elements in plateau is odd, the element at the middle will return true, while the others return false.

      • If even, the element on the left side of the two middle elements will return true, while the others return false.