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

조회 수: 3 (최근 30일)
Naor Movshovitz
Naor Movshovitz 2016년 12월 5일
댓글: Naor Movshovitz 2016년 12월 5일
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
Naor Movshovitz
Naor Movshovitz 2016년 12월 5일
We may assume v is a vector.
KSSV
KSSV 2016년 12월 5일
what is mtd?

댓글을 달려면 로그인하십시오.

채택된 답변

Walter Roberson
Walter Roberson 2016년 12월 5일
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
Guillaume
Guillaume 2016년 12월 5일
편집: Guillaume 2016년 12월 5일
... 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 2016년 12월 5일
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.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by