Linear interpolation with multiple values for each point

3 次查看(过去 30 天)
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