Filter löschen
Filter löschen

What data points does interp1 use for linear interpolation?

1 Ansicht (letzte 30 Tage)
Leslie
Leslie am 30 Jun. 2019
Bearbeitet: dpb am 1 Jul. 2019
What original data points does interp1 use for linear interpolation when there are multiple original data points between the query points? Only the orginal locations nearest the query points? All the original locations between query points?
BACKGROUND: I have data collected by instruments attached to a weather balloon. Some of these soundings have roughly (but not exactly) 5 meter vertical resolution. Others have very irregular resolutions, e.g the difference between vertical locations ranges from a few to 700 meters and these differences are not a simple function of altitude. Both types of soundings need to be interpolated to a 50m vertical grid. I want to do it with linear interpolation, for compatability with a large body of previous work.

Antworten (1)

dpb
dpb am 1 Jul. 2019
Bearbeitet: dpb am 1 Jul. 2019
inter1 does linear interpolation between points unless you use 'nearest'|'next''|'previous' for the method. It also requires the x-interpolating vector be unique so there is no ambiguity of what points would be used.
If your soundings do have duplicated altitudes (guess probably not likely), then you'll have to differentiate between them by at least eps(elev) to use interp1
  3 Kommentare
Leslie
Leslie am 1 Jul. 2019
@dpb, Thank you for the quick answer. However, I know that interp1 "does linear interpolation between points unless you use 'nearest'|'next''|'previous' ". I want to be clear on whether or not it uses only the nearest point on either side of the query point to do that interpolation.
dpb
dpb am 1 Jul. 2019
Bearbeitet: dpb am 1 Jul. 2019
What else would/could it use for linear interpolation?
You can always try it out and see if you don't believe...
Or, of course, unless you extrapolate...

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Mathematics finden Sie in Help Center und File Exchange

Produkte


Version

R2019a

Community Treasure Hunt

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

Start Hunting!

Translated by