MATLAB: Complete a matrix by means of another matrix

averagecountermatrix

I have 2 Matrices.one of them is full and i want to fill another one be means the fist one.in the second Matrix i have some gap instaed of gap i would to fill it with average of data.

Best Answer

Use interp1 and linear interpolation, e.g.:
>> FR = [0.1,0.3,0.5,0.6,0.7];
>> MR = [ 1 3, 5, 6, 7];
>> Fx = 0.1:0.1:0.6;
>> Mx = interp1(FR,MR,Fx)
Mx =
1.0 2.0 3.0 4.0 5.0 6.0