Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: interpolate missing data
Date: Tue, 6 May 2008 18:39:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 31
Message-ID: <fvq8k7$4h2$1@fred.mathworks.com>
References: <fvq09u$59o$1@fred.mathworks.com> <fvq12t$n6i$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-05-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210099143 4642 172.30.248.35 (6 May 2008 18:39:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 May 2008 18:39:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1376919
Xref: news.mathworks.com comp.soft-sys.matlab:466978



Thanks John,

Here is what I did, and it seems to have worked, I just 
wanted to get your blessing.  Also, I was not sure how to 
implement a &#8216;spline&#8217; interpolation using your 
inpaint_nans.m function. 




a = magic(4); a(2,2) = NaN ; a(3,3)=NaN
[M,N] = size(a);
    for k = 1:length(M)
a=inpaint_nans(a)
    end

a =

    16     2     3    13
     5   NaN    10     8
     9     7   NaN    12
     4    14    15     1


a =

   16.0000    2.0000    3.0000   13.0000
    5.0000    6.0000   10.0000    8.0000
    9.0000    7.0000   11.0000   12.0000
    4.0000   14.0000   15.0000    1.0000