The qinterp1 method came out ahead in all parameters tested. ![]() The same x, y, and xi vectors were used for each algorithm. The attached image shows the result of speed tests performed on a 2.4GHz, 2GB Windows XP machine. This should be backwards compatible for quite a few releases. Type "help qinterp1" for usage instructions. This function will return an error if the y and xi arrays are not both column or both row vectors. ![]() Per John D'Errico's suggestion, the nearest-lower-neighbor method has been changed to now use true nearest-neighbor interpolation (at a slight speed cost).Ī note on error checking: Because any error checking of the library array would destroy the flat scaling law, this function performs no error checking on the library (x and y) arrays. Like interp1, qinterp1 returns NaN for xi values that are out of bounds. qinterp1 requires an evenly spaced, monotonically increasing x array. In the limit of large library arrays, qinterp1 has a flat scaling, while interp1 has a linearly increasing scaling (see the image for this file). ![]() In the limit of small library and search arrays, it is ~5x faster. This function performs interpolation faster than MATLAB's "interp1" function.
0 Comments
Leave a Reply. |