How can I interpolate a data set given by 5 "inputs"?
이전 댓글 표시
I have a question related to an interpolation process. My data set is given in the following way:
An array Y which contains several vectors as follows:
Y = [Y1; Y2; Y3; Y4; Y5; Y6; .... Y32];
Each of these vector is defined as: Y1 = [0,0,0,0,0], Y2 = [0,0,0,0,1],....
Then, every Y_i vector has an evaluated parameter. For instance, V(Y1) = 80, V(Y2) = 90 leading to a vector V whose length is 32.
My goal is to get the value for any configuration of the Y vector, for example, xq = [0,0,0.5,0,1].
I tried it via the interpn function as follows:
vq = interpn(Y,V,xq,'linear');
Where,
[x1,x2,x3,x4,x5] = ndgrid(0:0.5:1);
xq = [x1(:) x2(:) x3(:) x4(:) x5(:)];
But I obtained an error using griddedInterpolant/subsref -> "The input data has inconsistent size".
Is it possible to carry out this kind of interpolation? Thanks in advance.
댓글 수: 2
dpb
2019년 11월 26일
"goal is to get the value for any configuration of the Y vector, ..."
What does "configuration" mean here, exactly? A lookup of a five-vector?
Could help by attaching the array and giving some sample inputs with expected outputs (and why are the correct ones)...
Antonio Jimenez-Carrascosa
2019년 11월 26일
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!