3input vs 1 output Interpolation Problem

Hello !
I have a set of data attached (Data.xlsx), there are 3 input vectors and 1 output vector, output vector named 'Error', Input vectors named X,Y,Z. based on this ,I would like to make an interpolation table so that I can use it for other intermidiate input values to get output.
please help to find a way how can I use interpolation in Matlab for 3 inputs and one output ?

 採用された回答

Ameer Hamza
Ameer Hamza 2020 年 10 月 23 日
編集済み: Ameer Hamza 2020 年 10 月 23 日

0 投票

You need to use scatteredInterpolant()
data = readtable('Data.xlsx');
idx = find(isnan(data.X), 1);
data(idx:end, :) = [];
mdl = scatteredInterpolant(data.X, data.Y, data.Z, data.Error);
err_val = mdl(245, 1500, 50) % interpolate at x = 245, y = 1500, z = 50

1 件のコメント

Abyay Ray
Abyay Ray 2020 年 10 月 23 日
Thanks a lot ...its working...

サインインしてコメントする。

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2020 年 10 月 23 日

0 投票

t = rmmissing(readtable('Data.xlsx'));
x=t.X; y=t.Y; z=t.Z; err=t.Error;
F = scatteredInterpolant(x,y,z,err);
%now F(x,y,z) gives you the interpolation.
%to visualize:
[X,Y,Z] = meshgrid(linspace(min(x),max(x),50),linspace(min(y),max(y),50),linspace(min(z),max(z),50));
E = F(X,Y,Z);
v = -50:12.5:25;
for V = v; isosurface(X,Y,Z,E,V); end
colorbar
You have some obvious discontinuities for Error == 0, especially near x == 75; you might want to look at those values more closely. Be sure to rotate the plot as some of the graphs are odd.

カテゴリ

ヘルプ センター および File ExchangeTables についてさらに検索

質問済み:

2020 年 10 月 23 日

コメント済み:

2020 年 10 月 23 日

Community Treasure Hunt

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

Start Hunting!

Translated by