Skip to content

XWidthAtYVal

X-axis width spanned by points where Y reaches a target.

M = XWidthAtYVal(X, Y, v)

Given paired samples X and Y, returns the X-axis distance between the first and last points where Y equals the target value v. Common for measuring pulse width, full-width-half-maximum (FWHM) of a peak, etc.

MathJet-specific (not in MATLAB).

x = linspace(-5, 5, 100);
y = exp(-x.^2); % Gaussian centered at 0
XWidthAtYVal(x, y, 0.5) % ≈ 1.665 (FWHM = 2*sqrt(ln 2))
  • XAtYVal — X value where Y equals a target (interpolated).
  • YAtXVal — Y value where X equals a target (interpolated).

Also categorized under: Range Functions / Math.