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 Center および File ExchangeInterpolation についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by