From: Stavros Vagionitis on
Is it possible to call meshgrid for non-zero values?

I have a 2-D matrix and I want to do bilinera interpolation to the zero values. I tried to do it with find but the interp2 says that X and Y values must be from meshgrid. Is there any other way?

Thank you in advance.

Stavros
From: John D'Errico on
"Stavros Vagionitis" <stavros.vagionitis(a)gmail.com> wrote in message <i2cqv6$ptb$1(a)fred.mathworks.com>...
> Is it possible to call meshgrid for non-zero values?
>
> I have a 2-D matrix and I want to do bilinera interpolation to the zero values. I tried to do it with find but the interp2 says that X and Y values must be from meshgrid. Is there any other way?
>

I have no certain idea what you are asking.

However, it SOUNDS as if you wish to fill in the zero
elements, by interpolating from the surrounding
elements. This is NOT what meshgrid does, nor can
interp2 do it. However, you can do it with my
inpaint_nans code from the file exchange. Replace
the zeros with NaNs, and then call my code.

http://www.mathworks.com/matlabcentral/fileexchange/4551

HTH,
John