Path: news.mathworks.com!not-for-mail
From: "John D'Errico" <woodchips@rochester.rr.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: interpolate missing data
Date: Wed, 7 May 2008 01:12:03 +0000 (UTC)
Organization: John D'Errico (1-3LEW5R)
Lines: 77
Message-ID: <fvqvl3$sv8$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> <fvqjf3$mp2$1@fred.mathworks.com>
Reply-To: "John D'Errico" <woodchips@rochester.rr.com>
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 1210122723 29672 172.30.248.38 (7 May 2008 01:12:03 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Wed, 7 May 2008 01:12:03 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 869215
Xref: news.mathworks.com comp.soft-sys.matlab:467046



"Hydroman S" <amirgsalem@gmail.com> wrote in message 
<fvqjf3$mp2$1@fred.mathworks.com>...
> % 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 "|".

The latter error happened in an older 
release of Matlab. Inpaint_nans uses a
facility that was introduced after version
6.1. So it is not backwards compatible to
the older release.

The first message is a warning message,
not an error. I'm surprised that it happens
on that matrix, since I don't get that when
I run this test. You are using an older
release of Matlab than I have, so I must
presume that it is version specific, and
resolved with my newer release. The
result is at least correct despite the
warning message.

John