Fast interpolation Matlab script

SPONSORED LINKS

    Specification

  • Version:
  • File size: 0 KB
  • File name: qinterp1.m
  • Last update:
  • Platform: Windows / Linux / Mac OS / BSD / Solaris
  • Language: Matlab
  • Price:Freeware
  • Company: Nathaniel Brahms (View more)

Fast interpolation script description:




Publisher review:
Fast interpolation performs nearest-neighbor or linear interpolation much faster than interp1 when an evenly-spaced lib This function performs interpolation faster than MATLAB's "interp1" function. In the limit of small library and search arrays, it is ~5x faster. 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). qinterp1 requires an evenly spaced, monotonically increasing x array. Like interp1, qinterp1 returns NaN for xi values that are out of bounds.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).A 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. This function will return an error if the y and xi arrays are not both column or both row vectors.Type "help qinterp1" for usage instructions.This should be backwards compatible for quite a few releases. It is platform-independent.The attached image shows the result of speed tests performed on a 2.4GHz, 2GB Windows XP machine. The same x, y, and xi vectors were used for each algorithm. The qinterp1 method came out ahead in all parameters tested. Note that, surprisingly, in the case of evenly-spaced x vectors, interp1q is slower than interp1 for most parameters, and interp1's nearest-neghbor interpolation is almost always slower than linear interpolation!Note: After writing this function, I noticed Umberto Picchini's fast interpolation function, which provides up to a 4x speedup without the requirement of an evenly-spaced array. The file ID is 8627.
Fast interpolation is a Matlab script for Mathematics scripts design by Nathaniel Brahms. It runs on following operating system: Windows / Linux / Mac OS / BSD / Solaris.

Operating system:
Windows / Linux / Mac OS / BSD / Solaris

Latest script and internet news

222

222

22

Posted on: 18 Jul 2023 22:27 by A. Brown

111

111

111

Posted on: 18 Jul 2023 22:24 by A. Brown

The permanently active Push system offered by the new Google Chrome 42

The permanently active Push system offered by the new Google Chrome 42

Hacked By !Sc-sT

Posted on: 17 Mar 2015 07:57 by A. Brown

SPREAD THE WORD

User Rating


Rating: 2.2 out of 5
Based on 13 ratings. 13 user reviews.

  • Currently 2.15 out of 5
  • 1
  • 2
  • 3
  • 4
  • 5