Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: interpolate missing data
Date: Tue, 6 May 2008 21:44:03 +0000 (UTC)
Organization: The MathWorks, Inc.
Lines: 57
Message-ID: <fvqjf3$mp2$1@fred.mathworks.com>
References: <fvq09u$59o$1@fred.mathworks.com> <fvq12t$n6i$1@fred.mathworks.com> <fvq8k7$4h2$1@fred.mathworks.com> <fvq9nr$amm$1@fred.mathworks.com> <fvqclj$81r$1@fred.mathworks.com> <fvqi7n$al5$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1210110243 23330 172.30.248.38 (6 May 2008 21:44:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 6 May 2008 21:44:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1376919
Xref: news.mathworks.com comp.soft-sys.matlab:467017



% the example

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

if I paste above example in matlab 7.0.0.19920 (R14), this 
is the output I get:

a =

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


b =

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

Warning: Matrix is singular to working precision.
> In inpaint_nans at 170
Warning: Matrix is singular to working precision.
> In inpaint_nans at 170

c =

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


and if I paste it in matlab 6.1.0.450 (R12.1), this is 
what I get:

a =

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

??? Error: File: C:\MATLAB6p1\work\inpaint_nans.m Line: 
123 Column: 16
Expected a variable, function, or constant, found "|".