Interpolating to latitude, longitude and time

Hi,
I have a database with columns of latitude, longitude, time and a variable. I want to interpolate that variable to the latitude, longitude and time of another database. How can I do that?
VERSION: MATLAB 2019b

 Accepted Answer

Read about interp1 and interp2.

6 Comments

The problem is my data of longitude and latitude are not monotonically increasing. I don't know how to solve it.
Have a look on griddata, ScatteredInterpolant.
Share your data.
How can I send a .xlsx example of my data??
You can attach here
T = readtable('EXAMPLE_DATA.xlsx') ;
X = T.X ;
Y = T.Y ;
Z = T.Z ;
V = T.V ;
Xq = T.Xq ;
Yq = T.Yq ;
Zq = T.Zq ;
% Vq = griddata(X,Y,Z,V,Xq,Yq,Zq) ;
F = scatteredInterpolant(X,Y,Z,V,'nearest') ;
Vq = F(Xq,Yq,Zq) ;
scatter3(X,Y,Z,[],V,'h','filled')
colorbar
figure
scatter3(Xq,Yq,Zq,[],Vq,'h','filled')
colorbar
That's exactly what I want. Thanks!!!

Sign in to comment.

More Answers (0)

Categories

Find more on Interpolation in Help Center and File Exchange

Asked:

on 7 May 2021

Commented:

on 7 May 2021

Community Treasure Hunt

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

Start Hunting!