Select four surrounding grid points
이전 댓글 표시
I have the latitude and longitude location of a certain observation and a square latitude and longitude grid of model data. I need to calculate a bilinear interpolation of the 4 model grid points surrounding this observation to the observation. However I'm stuck on how to select these surrounding 4 grid points? Any ideas as to how I could do this in Matlab would be appreciated?
I've tried calculating the actual distance from the observation location and then selecting the 4 nearest points but I realised this doesn't necessarily select the 4 surrounding points.
답변 (1개)
Matt J
2013년 2월 15일
0 개 추천
INTERP2 or griddedInterpolant() will do the entire interpolation operation for you.
댓글 수: 5
James
2013년 2월 15일
James
2013년 2월 15일
Matt J
2013년 2월 16일
Then how would bilinear interpolation be applicable to you? It sounds like you have scattered data and should be using TriScatteredInterp.
James
2013년 2월 17일
There appear to be a lot of contradictions now in what you're saying. Initially, you seemed to be saying that your lat(i,j) and lon(i,j) matrices do not contain plaid sample locations, as output from ndgrid/meshgrid. If they are not plaid, how can the data not be scattered? If they are plaid, there's no need to go through meshgrid/ndgrid. You should be able to use them in interp2/griddedInterpolant as is. They're either plaid or they're not plaid. They can't be neither or both. So which is it?
카테고리
도움말 센터 및 File Exchange에서 Interpolation에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!