# 5D-Interpolation of scattered Data

16 ビュー (過去 30 日間)
Felix Westermann 2021 年 10 月 28 日

Hello everyone,
i have the following problem. Several tests were made over certain operating points (Xn). As a result, the measured value (Y) was recorded and stored. Unfortunately, not all operating points could be approached. Therefore, some lines in Y are empty.
As an example, I've attached a simple Excel-File with invented (but logical) values.
My goal is to interpolate between the discrete operating points (Xn).
For Example, my matlab-function should determinate a Y-value for (I think, linear-interpolation should be ok):
X1 = 2.2
X2 = 28
X3 = 180
X4 = 3
Does anyone have an idea how to do that?
Thank you very much!
I am very excited!

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

### 回答 (1 件)

Rishabh Singh 2021 年 11 月 1 日
If you want to calculate the value "Y", for any certain combination of { X1, X2, X3,X4 } you can look into linear regression. Also as your data has "NaN" values, you should use remmissing to remove missing values out from your data. Also consider looking into feval for evaluation of function value.
X = cell(4,1);
for i =1:4
X{i} = data(:,i);
end
data = table2array(rmmissing(data));
Y = data(:,5);
mdl = fitlm(data(:,1:4), Y)
output = feval(mdl, 2.2,28,180,3);
The above code is just a simple implementation, you can look into the linear regression documentation for additional information.
Hope this helps.

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

R2020b

### Community Treasure Hunt

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

Start Hunting!