How to interpolate between two sets of data

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

Answers (3)

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.
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);

Categories

Find more on Interpolation in Help Center and File Exchange

Tags

No tags entered yet.

Asked:

on 12 Jan 2019

Answered:

on 12 Jan 2019

Community Treasure Hunt

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

Start Hunting!