필터 지우기
필터 지우기

Extrapolating corner values in matrix

조회 수: 3 (최근 30일)
Martin Olafsen
Martin Olafsen 2017년 10월 5일
편집: John D'Errico 2017년 10월 5일
Hi I am trying to extrapolate the corner values in a 3x3 matrix. I have tried using both the griddata and interp2 function. I plan to be using interp2 to extract values once I have defined the corner values. I have tried defining the corner values as NaN and 0 when using the functions. These are my test data:
V = [[0 2.05 0]', [1.96 1.76 1.88]', [0 1.74 0]'];
T = [1 2 3];
P = [1 2 3];
%attempt = griddata(T, P, V, [1], [1], 'linear');
%attempt2 = interp2(T, P, V, 1, 1); %Obviously these return 0.
How should I define my corners to produce values? Is there some other function I should use? I am currently using version 2007a.
Regards

채택된 답변

John D'Errico
John D'Errico 2017년 10월 5일
편집: John D'Errico 2017년 10월 5일
V = [[NaN 2.05 NaN]', [1.96 1.76 1.88]', [NaN 1.74 NaN]']
V =
NaN 1.96 NaN
2.05 1.76 1.74
NaN 1.88 NaN
Vhat = inpaint_nans(V,2)
Vhat =
2.005 1.96 1.81
2.05 1.76 1.74
1.965 1.88 1.81
inpaint_nans is on the file exchange for download.

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Fourier Analysis and Filtering에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by