Path: news.mathworks.com!newsfeed-00.mathworks.com!newsfeed2.dallas1.level3.net!news.level3.com!postnews.google.com!u10g2000prl.googlegroups.com!not-for-mail
From: "Parag S. Chandakkar" <parag2489@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Calculating variance disregarding NAN's
Date: Sun, 6 Nov 2011 14:21:23 -0800 (PST)
Organization: http://groups.google.com
Lines: 20
Message-ID: <9a6d3af6-8d08-4220-96f8-13e2f1e2c0e6@u10g2000prl.googlegroups.com>
References: <j970vd$3ge$1@newscl01ah.mathworks.com>
NNTP-Posting-Host: 68.99.85.159
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
X-Trace: posting.google.com 1320618083 11889 127.0.0.1 (6 Nov 2011 22:21:23 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Sun, 6 Nov 2011 22:21:23 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: u10g2000prl.googlegroups.com; posting-host=68.99.85.159; posting-account=M-hD1woAAAB--jvD8Y75uwPQ0Q-_S_Hd
User-Agent: G2/1.0
X-Google-Web-Client: true
X-Google-Header-Order: HNKUARELSC
X-HTTP-UserAgent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/535.2
 (KHTML, like Gecko) Chrome/15.0.874.106 Safari/535.2,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:748445

On Nov 6, 3:16 pm, "Ulrik Nash" <u...@sam.sdu.dk> wrote:
> Hi,
>
> I am not the proud owner of the statistics toolbox, so nanvar is not part of my arsenal. What command will allow me to cakculate the variance of each column of A, when these columns included NAN's and these should be ignored?
>
> Regards,
>
> Ulrik.

%%%%%%%%%%%%%%%%%%%%
a=[1 2 3 NaN 5];
 a(isnan(a))=[];
 var(a)
%%%%%%%%%%%%%%%%%%%%

Regards,
- Parag S Chandakkar.