Multiple calls to interpn using same vectors
이전 댓글 표시
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?
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Logical에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!