Interpolation for x,y,z values
Show older comments
I am doing interpolation of z using x & y values ..But I am getting NAN values using interpolation how can I removed this NAN and interpolate it to gives actual Value.. I am herewith attaching my Excel file, code and error

clear all
close all
clc
a=xlsread('Book2.xlsx')
x = a(:,1);
y =a(:,2);
z = a(:,3);
xq=[800 1000 1250 1500 1750 2100 2500 3000 3500 4000 4500 5000 5500 6000 6500];
yq=(100:100:2700)'
vq = griddata(x,y,z,xq,yq)
mesh(xq,yq,vq)
hold on
plot3(x,y,z,'o')
Accepted Answer
More Answers (1)
Mathias Smeets
on 29 Jul 2022
0 votes
You are getting NaN points because some query points (for example your lowest y-values) are outside your actual data. It is not possible to extrapolate with the griddata function. Look this link for more information.
1 Comment
Prasad Joshi
on 29 Jul 2022
Categories
Find more on Interpolation in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
