Faster linear Interpolation

Version 1.3.0.0 (4,82 KB) von Jeffrey Wu
Much faster version of the interp functions, but ONLY for LINEAR interpolation
3,9K Downloads
Aktualisiert 4. Aug 2010

Lizenz anzeigen

I threw this together for myself, because I wanted a version of interp with differences 1, 2, and 3 (below). I'm sure it's not as fast as it could be - feel free to comment on any potential improvements, or on any bugs.

Differences from MATLAB built-in functions:
1. MUCH faster
2. Extends border values instead of returning NaN
3. If coordinate is exactly on the spot, it doesn't look at neighbors. Example of why this might be relevant:
interpolate([blah, blah2], [desiredvalue, NaN], blah) returns desiredvalue instead of NaN
4. Order of X/Y arguments switched for 2d and 3d interpolate
5. Only takes a scalar query value (I will change this sometime perhaps, when I feel like it, or if I see that people actually care and want to use my function)

Anyways, I know it's really simple, and most of you could have coded it yourself, but hope you find good use for this!

Zitieren als

Jeffrey Wu (2026). Faster linear Interpolation (https://de.mathworks.com/matlabcentral/fileexchange/28376-faster-linear-interpolation), MATLAB Central File Exchange. Abgerufen.

Kompatibilität der MATLAB-Version
Erstellt mit R2010a
Kompatibel mit allen Versionen
Plattform-Kompatibilität
Windows macOS Linux
Kategorien
Mehr zu Interpolation finden Sie in Help Center und MATLAB Answers
Version Veröffentlicht Versionshinweise
1.3.0.0

description update

1.0.0.0