Filter löschen
Filter löschen

5D-Interpolation of scattered Data

12 Ansichten (letzte 30 Tage)
Felix Westermann
Felix Westermann am 28 Okt. 2021
Beantwortet: Rishabh Singh am 1 Nov. 2021
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!

Antworten (1)

Rishabh Singh
Rishabh Singh am 1 Nov. 2021
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.

Kategorien

Mehr zu Interpolation finden Sie in Help Center und File Exchange

Produkte


Version

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by