필터 지우기
필터 지우기

Please help with the correct syntax for this interpolation (interp2)

조회 수: 3 (최근 30일)
Hi,
I want to use a 2D-interpolation, but I do not understand the syntax of interp2. I simplified my acutal problem so it is easier to concentrate on what is going on.
Let say I have matrix A and I want to use interp2 to obtain matrix B. I want to have linear interpolation resulting in a matrix in which the steps between points in the last row of A become exactly 1. What should be the syntax so I can use a similar solution for my actual problem.
A = [2 4 6 8 10;
1 2 3 4 10];
% Here should be something like B = interp2(A,XXXXXXXX) to obtain the result below.
B = [2 4 6 8 8.3333 8.6667 9 9.3333 9.6667 10
1 2 3 4 5 6 7 8 9 10];

채택된 답변

Bjorn Gustavsson
Bjorn Gustavsson 2021년 3월 3일
That seems like a task for interp1:
B(2,:) = A(2,1):A(2,end);
B(1,:) = interp1(A(2,:),A(1,:),'linear');
HTH

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Multirate Signal Processing에 대해 자세히 알아보기

제품

Community Treasure Hunt

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

Start Hunting!

Translated by