Skip to content

YAtXVal

Y value where X equals a target (interpolated).

M = YAtXVal(X, Y, v)
M = YAtXVal(X, Y, v, flag)

Given paired samples X and Y, returns the Y coordinate at the point where X equals the target value v, interpolating linearly when needed. Useful for sampling a curve at specific x values.

MathJet-specific (not in MATLAB). Equivalent to a 1D interp1(X, Y, v, 'linear').

x = 0:10; y = x.^2;
YAtXVal(x, y, 4.5) % 20.25 (linear interp between y(5)=16 and y(6)=25)
  • XAtYVal — X value where Y equals a target (interpolated).
  • XWidthAtYVal — X-axis width spanned by points where Y reaches a target.

Also categorized under: Range Functions / Math.