How to interpolate between two sets of data
Afficher commentaires plus anciens
Good day all,
Please i have been trying to interpolate my experimental and predicted data set in matlab but all to no avail .
experimental predicted
966 1033
1072 1051
1144 1062
1186 1070
1200 1077
1191 1087
My wish is actually to have value that fall in between the experimental and predicted data.
Thank you
Réponses (3)
madhan ravi
le 12 Jan 2019
0 votes
Star Strider
le 12 Jan 2019
I am not exactly certain what result you want.
Try this:
% experimental predicted
D = [ 966 1033
1072 1051
1144 1062
1186 1070
1200 1077
1191 1087];
Result = [D(:,1), median(D,2), D(:,2)]
producing:
Result =
966 999.5 1033
1072 1061.5 1051
1144 1103 1062
1186 1128 1070
1200 1138.5 1077
1191 1139 1087
You could use either mean or median. I chose median here, because it calculates the exact midpoint.
Image Analyst
le 12 Jan 2019
Pick the percentage of the way you want to be in between the values and then just do a weighted sum:
output = experimental + percentage * (predicted - experimental);
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!