Getting values using coordinates indexes

조회 수: 3 (최근 30일)
SnovG
SnovG 2015년 6월 8일
댓글: K E 2015년 8월 5일
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
SnovG
SnovG 2015년 6월 8일
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

댓글을 달려면 로그인하십시오.

답변 (1개)

Chad Greene
Chad Greene 2015년 6월 8일
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
SnovG
SnovG 2015년 6월 10일
thank you!
K E
K E 2015년 8월 5일
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.

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

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

Start Hunting!

Translated by