Problem with griddata giving NaN
이전 댓글 표시
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
KSSV
2021년 8월 16일
This is an extrapolation, the interpolated point do not lie in the intervel of given points.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Interpolation of 2-D Selections in 3-D Grids에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!