How can I interpolate a pressure vector to the surface?
Mostrar comentarios más antiguos
I am working with a pressure vector whose coordinates are between [10,1000] in hPa with 32 pressure values and it is defined between 20ºN-50ºN and 180ºW-180ºE with a resolution of 1º, but now I need to interpolate it to the surface for each latitude and longitude to have a value for the surface pressure in each grid point. How can I do it?
Thnak you so much
Respuesta aceptada
Más respuestas (1)
Andrei Bobrov
el 20 de Jul. de 2013
Editada: Andrei Bobrov
el 22 de Jul. de 2013
lon = randi([-180,180],32,1);
lat = randi([20,50],32,1);
P = randi([10,1000],32,1); % your data
F = scatteredInterpolant(lat,lon,P,'natural','linear');
[xq,yq] = ndgrid(20:50, -180:179);
pv = F(xq,yq);
figure
mesh(xq,yq,pv);
hold on
plot3(lat,lon,P,'o');
ADD
lon = randi([-180,180],32,1);
lat = randi([20,50],32,1);
P = randi([10,1000],32,1); % your data
[xq,yq] = ndgrid(20:50, -180:179);
vq = griddata(lat,lon,P,xq,yq,'cubic');
figure
mesh(xq,yq,vq);
hold on
plot3(lat,lon,P,'o');
5 comentarios
Youssef Khmou
el 20 de Jul. de 2013
Editada: Youssef Khmou
el 20 de Jul. de 2013
Andrei, which version contains the function scatteredInterpolant ?
Andrei Bobrov
el 20 de Jul. de 2013
R2013a (8.01)
Francis
el 21 de Jul. de 2013
Andrei Bobrov
el 21 de Jul. de 2013
Andrei Bobrov
el 22 de Jul. de 2013
See ADD part in this answer.
Categorías
Más información sobre Interpolation en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!