I have been trying to use the interp3 function on Matlab but I keep getting an error.

I have 4 columns of data, and have sample points which I want to interpolate to get the value of the 4th column:

I have tried the following:

model_data = readtable('example_csv.csv');

model_a = model_data.a;
model_b = model_data.b;
model_c = model_data.c;
model_d = model_data.d;

query_data = readtable('query_points.csv');
query_a = query_data.a;
query_b = query_data.b;
query_c = query_data.c;

interp_d = interp3(model_a, model_b, model_c, model_d, query_a, query_b, query_c);

but I get the error

Error using griddedInterpolant
Interpolation requires at least two sample points for each grid dimension.

Error in interp3 (line 132)
        F = griddedInterpolant({X, Y, Z}, V, method,extrap);
 

Would be grateful for any help.

New contributor

htn is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.