Interpolation of 3 dimensional values from a excel file

3 views (last 30 days)
kyungdoo lee
kyungdoo lee on 19 Oct 2021
Commented: kyungdoo lee on 20 Oct 2021
how should i interpolate them so that i can give any value of x and y in between the range to get ultimate value of z.
i have attached a file of values for more clarity.

Accepted Answer

KSSV on 19 Oct 2021
Read about interp2.
T = readtable('') ;
T = table2array(T) ;
x = T(1,2:end);
y = T(2:end,1);
Z = T(2:end,2:end); % use fillmissing to fill NaNs
[X,Y] = meshgrid(x,y) ;
% do interpolation
m = 100;
xi = linspace(min(x),max(x),m) ;
yi = linspace(min(y),max(y),m);
[Xi,Yi] = meshgrid(xi,yi);
Zi = interp2(X,Y,Z,Xi,Yi);

Sign in to comment.

More Answers (0)


Community Treasure Hunt

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

Start Hunting!