2D Lookup Table from a 6D Lookup Table via Interpolation
조회 수: 8 (최근 30일)
이전 댓글 표시
Hi everyone,
I have a question about lookup tables. I have a lookup Table for some aerodynamic data, that is depentend on 6 input parameters, so I have a 6D Lookup Table. If i know all the 6 parameters i can calculate the aerodynamic data via interpolation.
But i only have 4 input parameters, the other 2 are still unknown. So i want to create a 2D Lookup Table from the 6D one, that is dependent on the 2 unknown parameters.
What Matlab Function can you recomend me for this problem ?
Thank you so much :)
댓글 수: 0
답변 (1개)
Divyam
2025년 6월 13일
Assuming that you are looking to create the following 2D table
from the 6D table
by fixing the first 4 dimensions
you can use the "interpn" or the "griddedInterpolant" functions for your use case.
Example: Using the "interpn" function
% Define fixed values for the known dimensions
x1_val = 0.2;
x2_val = 0.5;
x3_val = 0.1;
x4_val = 1.0;
% Create a meshgrid for the 2D unknowns. Must match 5th and 6th grid
[X5q, X6q] = meshgrid(X5, X6);
% Interpolate over the 6D table
G = interpn(X1, X2, X3, X4, X5, X6, F, x1_val, x2_val, x3_val, x4_val, X5q, X6q);
Here G is a 2D matrix of the same size as
, which represents the aerodynamic data over the two unknowns
, holding the rest fixed.
For repeated queries with different fixed values, the "griddedInterpolant" function is more efficient:
F_interp = griddedInterpolant({X1,X2,X3,X4,X5,X6}, F);
G = arrayfun(@(x5,x6) F_interp(x1_val,x2_val,x3_val,x4_val,x5,x6), X5q, X6q);
For more information regarding the "interpn" and the "griddedInterpolant" function, refer to the following documentation:
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Nonlinearity에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!