MATLAB: 3input vs 1 output Interpolation Problem

9.5.0.1049112 (r2018b) update 3

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 ?

Best Answer

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