Interpolating graphs to match

조회 수: 1 (최근 30일)
new2matlab
new2matlab 2020년 7월 20일
답변: KSSV 2020년 7월 20일
Would I just use 1D interpolation to match up two graphs?

답변 (1개)

KSSV
KSSV 2020년 7월 20일
Yes very much possible. Check the below example.
% Generate two random graphs with different sizes
y1 = rand(1,100) ;
y2 = rand(1,70) ;
% lengths of each graph
n1 = length(y1) ;
n2 = length(y2) ;
% get y2 to size of y1
x2 = 1:n2 ;
xi2 = linspace(1,n2,n1) ;
% interpolate y2 to size of y1
yii = interp1(x2,y2,xi2) ;

카테고리

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