Multiple calls to interpn using same vectors
Afficher commentaires plus anciens
I do have a bunch of functions defined in the same domain but mapping to different values and I evaluate those functions with interpn as there's no closed form formula.
so lets say, the domain is D1 x D2 x D3 x D4 (all vectors) and each function (F1, F2, F3) maps its 4d arguments to a scalar value.
I'm evaluating each function at the same query points using interpn with linear interpolation like :
f1val=interpn(D1,D2,D3,D4,F1,dq1,dq2,dq3,dq4);
f2val=interpn(D1,D2,D3,D4,F2,dq1,dq2,dq3,dq4);
f3val=interpn(D1,D2,D3,D4,F3,dq1,dq2,dq3,dq4);
I'm guessing that each call would do 4 binary searches to find the nearest index points used to evaluated linear interpolation.
This code is going to be converted to C/C++ using Code generation. I was wondering if the Code generation would avoid doing search for the same query points in all instantiations of interpn. If not, how can I manually ensure that this is not the case?
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Logical dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!