matlab - Filling missing data in a data set -
matlab - Filling missing data in a data set -
i have info set following:
x= [1, 4, 10] y= [10, 20, 30] (x , y value pairs, i.e. (1,10), (4,20), (10,30))
i fill x values gaps , linear interpolated values y. linear interpolation should done between each value pair, i.e. between (1,10) , (4,20) , 1 time again between (4,20) , (10,30).
x= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] y= [10,?, ?, 20, ?, ?, ?, ?, ?, 30] how can solve matlab? regards, dennis
p.s. original info set has on 300 value pairs...
using interp1
code:
x= [1, 4, 10]; y= [10, 20, 30]; xi = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]; yi = interp1(x,y,xi); results:
>> yi yi = 10 13.333 16.667 20 21.667 23.333 25 26.667 28.333 30 graphical output using plot(xi,yi,'-*')
matlab dataset interpolation
Comments
Post a Comment