extract data according to specified lat,lon bounding box

3 vues (au cours des 30 derniers jours)
swetha S
swetha S le 26 Juin 2019
Commenté : swetha S le 26 Juin 2019
i have a 3d data, say dat(33*35*122). (lat,lon,time). Lat[6.5n to 38.5n], lon[66.5e to 100.5e]. now how can i extract the data for Lat[24.5n to 29.5] , lon[73.5e to 75.5e]. the data is of 1x1 degree resolution.
  2 commentaires
Bob Thompson
Bob Thompson le 26 Juin 2019
What do you mean by 'extract?' Do you just want to capture the data subset somewhere else? You can just use indexing for that. Things are a bit more complicated because you want to cover a range, but we can do that easily with logic.
Lat = 6.5:38.5;
Lon = 66.5:100.5;
latrng = ismember(Lat,[24.5:29.5]);
lonrng = ismember(Lon,[73.5:75.5]);
subset = data(latrng,lonrng,:);
swetha S
swetha S le 26 Juin 2019
thanks it worked

Connectez-vous pour commenter.

Réponses (1)

KSSV
KSSV le 26 Juin 2019
REad about interp2. Let X,Y,Z be your original data. And let Xi, Yi be your new grid.
Zi = interp2(X,Y,Z,Xi,Yi) ;

Catégories

En savoir plus sur Data Import and Export dans Help Center et File Exchange

Community Treasure Hunt

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

Start Hunting!

Translated by