XAtYMax
X value at the index where Y is maximum.
Syntax
Section titled “Syntax”M = XAtYMax(X, Y)Description
Section titled “Description”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).
Examples
Section titled “Examples”x = 1:5; y = [3 1 5 2 4];XAtYMax(x, y) % 3 (Y is max at index 3 → X(3))See also
Section titled “See also”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.