is interp1(x, v, x(k), mtd) == v(k) always true?

2 Ansichten (letzte 30 Tage)
Naor Movshovitz
Naor Movshovitz am 5 Dez. 2016
Kommentiert: Naor Movshovitz am 5 Dez. 2016
is
interp1(x, v, x(k), mtd) == v(k)
always true or does it depend on method and/or type of x and v? Followup: is the answer documented?
  2 Kommentare
Naor Movshovitz
Naor Movshovitz am 5 Dez. 2016
We may assume v is a vector.
KSSV
KSSV am 5 Dez. 2016
what is mtd?

Melden Sie sich an, um zu kommentieren.

Akzeptierte Antwort

Walter Roberson
Walter Roberson am 5 Dez. 2016
Yes, guaranteed. interp1 calls griddedInterpolant to do the work and that routine says,
"This surface always passes through the sample values at the point locations."
  2 Kommentare
Guillaume
Guillaume am 5 Dez. 2016
Bearbeitet: Guillaume am 5 Dez. 2016
... except that "interp1 calls griddedInterpolant" is not actually documented and so could be considered an implementation detail subject to change.
So it's guaranteed by the code as currently implemented but not by the documentation.
Naor Movshovitz
Naor Movshovitz am 5 Dez. 2016
Accepted Walter's answer because it points in the right direction: griddedInterpolant. I think this answers my question although perhaps I should have emphasized more strongly what I was really asking: when the query point is a sample point, is the returned value bit-wise equal to the value at the sample point? The wording of the documentation still leaves this a little uncertain. The interpolant can "pass through the sample value" in the mathematical sense but still fail a == comparison.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (0)

Kategorien

Mehr zu Mathematics and Optimization finden Sie in Help Center und File Exchange

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by