YAtXVal
Y value where X equals a target (interpolated).
Syntax
Section titled “Syntax”M = YAtXVal(X, Y, v)M = YAtXVal(X, Y, v, flag)Description
Section titled “Description”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').
Examples
Section titled “Examples”x = 0:10; y = x.^2;YAtXVal(x, y, 4.5) % 20.25 (linear interp between y(5)=16 and y(6)=25)See also
Section titled “See also”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.