Interpolation from a table

조회 수: 6 (최근 30일)
Domenico Sorvillo
Domenico Sorvillo 2022년 10월 30일
답변: Star Strider 2022년 10월 30일
Hello, I have put in my script a table like this one to find the value K0 :
i have both value e/b, for select column, and y/b for the rows.
As you can immagine i need a double interpolation to find my value of K0. If we put e/b = 0.23 (red) and y/b = 0.60 (blue) how can i select the values insite the intersection between the red columns and the blue rows for the final interpolation?
Hope is all clear
Ty for your answers

답변 (1개)

Star Strider
Star Strider 2022년 10월 30일
The interp2 function is one option —
eb = [0 0.25];
yb = [0.5; 0.75];
K0 = [1.0009 1.3767; 0.9948 1.5583];
Check = [NaN eb; yb K0]
Check = 3×3
NaN 0 0.2500 0.5000 1.0009 1.3767 0.7500 0.9948 1.5583
ebq = 0.1; % 'e/b' Value To Interpolate
ybq = 0.6; % 'y/b' Value To Interpolate
K0q = interp2(yb, eb, K0, ybq, ebq) % Interpolated 'K0' Value
K0q = 1.1788
figure
surfc(yb, eb, K0, 'FaceAlpha',0.9)
hold on
stem3(ybq, ebq, K0q, 'r', 'filled')
hold off
colormap(turbo)
grid on
xlabel('y/b')
ylabel('e/b')
zlabel('K0 (\theta = 0.20)')
.

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by