Interpolate to fill missing values in a temperature Matrix by considering the altitude (stored in a separate matrix)
조회 수: 7 (최근 30일)
이전 댓글 표시
Dear all,
I have got a matrix with temperatures (let's call it T), and a matrix with altitudes (let's call it Z). They're both 150x150.
T contains some missing values that I need to fill.
Rather than filling it with a basic linear interpolation, I need to fill it taking into account the altitude (Z).
Could you please suggest a code to fill the missing values in T weighted on Z?
Thanks a lot!
댓글 수: 2
dpb
2023년 4월 30일
With no more to go on than that, one would presume the location of the two already contains the variations in Z into account by position in the array. It wouldn't seem much else able to do other than interp2 around each missing location; unless, of course, the elevatioins in the other array are not representive of the location they occupy in the array -- in which case it wouldn't seem there would be sufficient data/knowledge available to do anything more, anyway, either.
답변 (1개)
Image Analyst
2023년 5월 3일
What exactly does "missing" mean to you? You can't have "holes" in the matrix. The values must either be nan, 0, or some other value.
help interp2
댓글 수: 5
Mathieu NOE
2023년 5월 7일
hello again
before you do the interpolation with interp1 , you have to make sure that the data (Zrow,Trow) are unique
use unique to remove duplicates
dpb
2023년 5월 7일
"...with interp1 , you have to make sure that the data (Zrow,Trow) are unique"
The functional also cannot be double-valued, so if your data follow the terrain up and down, that doesn't work, either.
참고 항목
카테고리
Help Center 및 File Exchange에서 Interpolation of 2-D Selections in 3-D Grids에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!