I'm having a problem averaging multiple curves using interp1
Afficher commentaires plus anciens
Hi everyone.
I have multiple polarisation curves that I want to display the averge of. I tried using linspace to create a base vector and interpolating using interp1. Unfortunately that hasn't properly worked for me and I was hoping someone might be able to help.
Thank you in advance!
Réponse acceptée
Plus de réponses (1)
Walter Roberson
le 11 Mar 2023
h = scatter(IVC_mean{2,z},IVC_mean{1,z});
So {1} is used as y values and {2} is used as x values.
IVC_mean{6,z} = min(IVC_mean{1,z});
IVC_mean{7,z} = max(IVC_mean{1,z});
min and max of the y values.
Umin = min(Umin);
Umax = max(Umax);
UC = linspace(Umin,Umax,10000);
smallest y and greatest y
IVC_mean{8,z} = interp1(IVC_mean{2,z},IVC_mean{1,z},UC,'spline');
you pass in known x values and corresponding known y values and you query based on UC, which is based on y values, not on x values.
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!