필터 지우기
필터 지우기

2D interpolation of data

조회 수: 11 (최근 30일)
RJSB
RJSB 2022년 11월 2일
답변: KSSV 2022년 11월 2일
I wish to perform 2D interpolation of a data. The data is such that
X Y V
1 1 7
2 3 9
3 5 8
4 6 4
implying that V(1,1)= 7, V(2,3) =9, V(3,5)= 8 and V(4,6) = 4. I wish to find the values of V(1,3), V(1,5), V(1,6), V(2,1), V(2,5) and so on (basically all V(i,j), i not equal to j). Since interp2 requires meshgrid format, from my reading of documentation, i guess that interp2 might not be a suitable function to use. Is it correct? What function can i use to interpolate such data. Pls help

채택된 답변

KSSV
KSSV 2022년 11월 2일
data = [1 1 7
2 3 9
3 5 8
4 6 4] ;
x = data(:,1) ;
y = data(:,2) ;
z = data(:,3) ;
F = scatteredInterpolant(x,y,z) ;
xi = [1 1 1 2 2 ];
yi = [3 5 6 1 5] ;
F(xi,yi)
ans = 1×5
25.4133 30.0933 25.0000 -8.1826 17.0233

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Interpolation에 대해 자세히 알아보기

태그

제품

Community Treasure Hunt

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

Start Hunting!

Translated by