5D-Interpolation of scattered Data

17 次查看(过去 30 天)
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
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.
data = readtable("Example.xlsx");
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.

类别

Help CenterFile Exchange 中查找有关 Interpolation 的更多信息

产品


版本

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by