how to use interp1() function
Afficher commentaires plus anciens
I have tried to use interpt(1) function as i have time and pressure data.
the pressure data is highly scattered it look like that

firstly,I have used function : p0q=interp1(p0,tq) as show belows
_____________________________________________________________________________________
t1=t(x1:x2);
p01=p0(x1:x2);
tq=t(x1):0.000001:t(x2);
p0q=interp1(p0,tq);
figure
plot (t1,p01,'o',tq,p0q,'*');
legend('p01','p0q');
_____________________________________________________________________________________
but the poq (interpolated result is empty) as shown in the figure

when i change it to
p0q=interp1(p0,tq,'pchip');
the interploted data are incorrect

is there something wrong in my code?or i am using the function incorrectly?
1 commentaire
KSSV
le 12 Fév 2020
Attach your data.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Interpolation dans Centre d'aide et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!
