"griddata" results in much smaller values than original data
Ältere Kommentare anzeigen
I am using "griddata" function to interpolate original data on query points. However, the interpolation value on the query points are much smaller than the original data. Is there any way to improve the interpolation?
2 Kommentare
I suspect your lon, lat values are not exactly corresponding to elev. While running the code did you see the warning?
Warning: Duplicate data points have been detected and removed - corresponding values have been averaged.
I suspect the high values correspond to diplicate lon, lat and have been removed.
When you check
nx = length(unique(lon)) ;
ny = length(unique(lat)) ;
nx*ny is not equal to 579072.
jie hu
am 18 Apr. 2023
Akzeptierte Antwort
Weitere Antworten (1)
KSSV
am 18 Apr. 2023
data=importdata('manila.dat');
lon=data(:,2);
lat=data(:,3);
elev=data(:,4);
xr = 118.7:0.2:121;
yr = 12.4:0.2:20.7;
[X, Y]= meshgrid(xr,yr);
idx = knnsearch([lon lat],[X(:) Y(:)],'k',10) ;
Z = reshape(max(elev(idx),[],2),size(X)) ;
plot3(lon(1:100:end),lat(1:100:end),elev(1:100:end),'o');
hold on
surf(X,Y,Z)
1 Kommentar
jie hu
am 20 Apr. 2023
Kategorien
Mehr zu Interpolation of 2-D Selections in 3-D Grids finden Sie in Hilfe-Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!

