Problem with griddata giving NaN
Show older comments
Let's supose I have three points
,
,
. In each point I have a data of temperature in multiple times. Here I offer a simplification of this problem:
lat = [27.5 29.3 30.1
27.5 29.3 30.1
27.5 29.3 30.1]; % Matrix of latitudes. Col1 = lat1, Col2 = lat2, Col3 = lat3.
lon = [16.5 18.9 19.9
16.5 18.9 19.9
16.5 18.9 19.9]; % Matrix of longitudes. Col1 = lon1, Col2 = lon2, Col3 = lon3.
temp = [23.5 27.8 30.5
25.9 21.3 45.8
54.3 20.1 10.4]; % i.e., temp(1,1) corresponds to (27.5,16.5), temp(1,2) corresponds to (29.3,18.9)...
time = [10 10 10
20 20 20
30 30 30]; % The first row of each matrix was measured at time 10.
Now, I want to find the temperature in
,
and
.
latQ = 28;
lonQ = 19.3;
timeQ = 25.3;
griddata(lat, lon, time, temp, latQ, lonQ, timeQ,'linear')
Why does griddata return NaN if my query points are "inside the limits"?
1 Comment
KSSV
on 16 Aug 2021
This is an extrapolation, the interpolated point do not lie in the intervel of given points.
Accepted Answer
More Answers (0)
Categories
Find more on Vector and Raster Map Display 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!