Linear interpolation with multiple values for each point
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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.
0 commentaires
Réponses (1)
David Goodmanson
le 26 Juil 2019
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
0 commentaires
Voir également
Catégories
En savoir plus sur Interpolation dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!