Error using the 'square' interpolation method in interp1 function

4 visualizaciones (últimos 30 días)
Thiha
Thiha el 7 de Sept. de 2022
Comentada: Thiha el 10 de Sept. de 2022
I am aware that there isn't a "square" method of interpolation for interp1 on the current documentation. However, I have come across a script which has interpolated a square relationship curve using the "square" method of interp1 and I'm getting an error when I try to run it.
Could this be a remnant of an older version of interp1? And if so, what is the new method called?
Thanks!

Respuestas (1)

Steven Lord
Steven Lord el 7 de Sept. de 2022
I don't believe there was ever a 'square' interpolation method in interp1. But the input argument checking in much older versions of interp1 was much looser than it is in current releases. I believe in those older releases it only checked the first character (which wouldn't work today, because 'nearest' and 'next' would be ambiguous as would be 'previous' and 'pchip') so try calling interp1 with the 'spline' method.

Categorías

Más información sobre Interpolation en Help Center y File Exchange.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by