Possible Duplicate:
Interpolating 2D data with missing values
I am trying to interpolate a 21x21 array of values. The 21x21 array sometimes has zero values and with the help of interpolation, I am replacing the zero with an appropriate value to get a reasonable output.
My code is as follows:
binmeans
dataInt = Flatten[binmeans]
int = Interpolation[Select[Transpose[{Range[Length[dataInt]], dataInt}],
Last[#] != 0 &], InterpolationOrder -> 1]
l = 1;
gTable1 = Table[0, {binSize}, {binSize}];
For[x = 1, x <= binSize, x++,
For [y = 1, y <= binSize, y++,
gTable1[[x, y]] = int[l];
l++]
]
I flatten the binmeans list, selected the values which are not zero, made an interpolation function, create another 21x21 table and populate it with the output of the interpolation function.
The final output is as follows:
And the expected output is this : 
The Interpolation function works by interpolating values on the x-axis only. I am wondering how can I interpolate by considering all the points in the surrounding (x and y axis interpolation). Thank you
