I am trying to fit a line (to a blue curve in the image) using spline, pchip or makima function, however, theses function do not work properly (red line).
2 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
0 Kommentare
Antworten (1)
John D'Errico
am 1 Okt. 2022
Bearbeitet: John D'Errico
am 1 Okt. 2022
They don't work, because your curve does not describe a SINGLE valuesd function y(x). That is, for many values of x, there are TWO values of y. You CANNOT use spline, makima or pchip to interpolate those points directly.
However, you CAN use tools that are designed to fit such a general space curve. For example, download my interparc from the file exchange. Interparc actually knows how to fit a curve to such a path in the plane, and it can apply either pchip or spline to such a curve properly. (Not makima, since makima was not part of MATLAB when I wrote the tool.)
Find interparc here:
If you have the curve fitting toolbox, it has cscvn, which can also fit such a space curve.
0 Kommentare
Siehe auch
Kategorien
Mehr zu Interpolation finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!