how can we calculate interpolation between two double MATLAB arrays?

조회 수: 6 (최근 30일)
Given two arrays of double of different sizes (A = 1054x1 and B = 601x1) how is it possible to perform an interpolation ??

채택된 답변

Star Strider
Star Strider 2019년 3월 15일
It depends on how you want to interpolate them. The‘safest’ way is likely to interpolate the longer vector to the length of the shorter vector:
A = sin((0:1053)/105)';
B = cos((0:600)/30)';
Ai = interp1((1:numel(A))', A, (1:numel(B)), 'linear', 'extrap');
You can then see the result (a sort of Lissajous figure):
figure
plot(Ai, B)
grid
  댓글 수: 8
Guido Pastore
Guido Pastore 2019년 3월 15일
Thank you so much for your help

댓글을 달려면 로그인하십시오.

추가 답변 (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