Skip to content

XAtYMax

X value at the index where Y is maximum.

M = XAtYMax(X, Y)

Given paired samples X and Y of the same length, returns the value of X at the index where Y is maximum. Useful for locating where a signal peaks.

MathJet-specific (not in MATLAB).

x = 1:5; y = [3 1 5 2 4];
XAtYMax(x, y) % 3 (Y is max at index 3 → X(3))
  • YAtXMax — Y value at the index where X is maximum.
  • XAtYMin — X value at the index where Y is minimum.
  • max — Maximum value along a dimension, or elementwise maximum of two inputs.

Also categorized under: Range Functions / Math.