Extracting values in 2D dataset with indices for lat and lon
조회 수: 3 (최근 30일)
이전 댓글 표시
Hello
I have a very simple problem:
I have a vector of indices I extracted for a latitude vector and a longitude vector. I would like to find the corresponding value at the specific latitude and longitude indices.
EX:
lat_indices = 471x1 lon_indices 471x1 data = 7200x3600 values = data(lon_indices lat_indices);
When I use this method, I keep getting all of the values as NaN, but I know that is incorrect.
Am I doing this the wrong way?
Thanks, Melissa
댓글 수: 0
채택된 답변
Chad Greene
2015년 3월 16일
Do you simply need a comma? You wrote,
values = data(lon_indices lat_indices);
Perhaps it should be
values = data(lon_indices,lat_indices);
댓글 수: 0
추가 답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 NaNs에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!