Getting values using coordinates indexes

3 visualizaciones (últimos 30 días)
SnovG
SnovG el 8 de Jun. de 2015
Comentada: K E el 5 de Ag. de 2015
I have a very simple question,
I have 3 matrices extracted from a netcdf file, latitude, longitude, and data values (Z). I would like to know the Z values corresponding to specific latitude and longitude points. How can I do this?
Thanks
  1 comentario
SnovG
SnovG el 8 de Jun. de 2015
These are thress matrices with the same size, 2630x1083 double, it is actually remote sensing data in netcdf format. I want to get the values corresponding to the coordinates. thanks

Iniciar sesión para comentar.

Respuestas (1)

Chad Greene
Chad Greene el 8 de Jun. de 2015
You can do this a few ways. If you know the exact lat and lon you're interested in, say (30N,120E), it's simply
Z(lat==30 & lon==120)
Alternatively, you can use interp2.
  4 comentarios
SnovG
SnovG el 10 de Jun. de 2015
thank you!
K E
K E el 5 de Ag. de 2015
Once you know the index to the lat/lon point you want, you can extract just the value there using ncread. In other words you don't have to pull the whole matrix into Matlab.

Iniciar sesión para comentar.

Community Treasure Hunt

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

Start Hunting!

Translated by