Interpolate the roots/positions of sign changes
Version 1.0.0 (1.72 KB) by
Max Mustermann
This function interpolates the x-positions of roots/sign changes in the data in y and adds the roots to the vectors.
Interpolate the x-positions of roots/sign changes in the data in y. This is helpful if you want to treat the positive and negative parts of y differently.
Example:
has three roots at
,
and
. The vector
x = linspace(-3, 3, 50)
does not include these roots.
y = x.^3 - 4.*x;
[xNew, yNew] = interpolateRoots(x, y)
interpolates the roots to
,
and
and returns the extended vectors xNew and yNew including these interpolated roots at the corresponding positions. xNew and yNew are 53 elements long while x and y contain 50 elements.
Cite As
Max Mustermann (2026). Interpolate the roots/positions of sign changes (https://www.mathworks.com/matlabcentral/fileexchange/103045-interpolate-the-roots-positions-of-sign-changes), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R2021b
Compatible with any release
Platform Compatibility
Windows macOS LinuxTags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0 |
