Interpolating graphs to match

Risposte (1)

KSSV
KSSV il 20 Lug 2020
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) ;

Categorie

Scopri di più su Interpolation in Centro assistenza e File Exchange

Richiesto:

il 20 Lug 2020

Risposto:

il 20 Lug 2020

Community Treasure Hunt

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

Start Hunting!

Translated by