I have a 500*4 matrix that reports an experimental result which depends on three other values (t,x,g). Something like this:
t x g result
1 2 3 3
2 2 4 2
2 2 1 3
...
I need to create a function that return the “result” for every given tuple (t,x,g) even if it is not present in the matrix. I think that I need a 4-d interpolation but I don’t know how to do it in Matlab. Can someone suggest a way to do it?
Use either TriScatteredInterp or griddata3. Both will solve your problem of interpolating data points in a scattered set. If the points do not lie inside the convex hull of the data, then those methods will still fail to extrapolate, but then no method is perfect.