Linear interpolation with multiple values for each point

조회 수: 2 (최근 30일)
Justin Wang
Justin Wang 2019년 7월 26일
답변: David Goodmanson 2019년 7월 26일
Let X be defined as the following:
[a, b, c] where a, b and c are real,
V be defined as the following:
[o, p, q
r, s, t
u, v, w
x, y, z] where all the aforementioned variables are real numbers,
and XQ be defined as d and e, where
a < d < b and b < e < c
I wish to find solution vectors for d and e which are the same length as each column in V, i.e., length(d') = 4 and the elements in d are linearly interpolated values between (o and p), (r and s), (u and v), and (x and y). How should I go about this task? Help greatly appreciated.
** I have already tried looping through with interp1(X(i), V(i), XQ(i)). My full data-sets are millions of elements, therefore, this is infeasable. I also cannot run this with parfor, because this is already running inside a function which gets called in an external parfor loop.**
** I cannot share code**
Thank you so much.

답변 (1개)

David Goodmanson
David Goodmanson 2019년 7월 26일
Hi Justin,
If the problem is what I think it is, with d and e known,
linear interpolation between o and p determined by a<d<b and
linear interpolation between p and q determined by b<e<c
then
M = [(b-d)/(b-a) 0
(d-a)/(b-a) (c-e)/(c-b)
0 (e-b)/(c-b)]
answer = V*M;
should work, where V can have any number of rows

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by