Path: news.mathworks.com!newsfeed-00.mathworks.com!solaris.cc.vt.edu!news.vt.edu!news.glorb.com!news-out.readnews.com!news-xxxfer.readnews.com!postnews.google.com!g2g2000vbs.googlegroups.com!not-for-mail
From: Tyler <hayes.tyler@gmail.com>
Newsgroups: comp.soft-sys.matlab
Subject: Circshift applied to columns by different amounts
Date: Fri, 16 Mar 2012 15:33:12 -0700 (PDT)
Organization: http://groups.google.com
Lines: 24
Message-ID: <b4d6be8b-3520-4e7b-8d44-726651eddcd4@g2g2000vbs.googlegroups.com>
NNTP-Posting-Host: 99.255.196.162
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
X-Trace: posting.google.com 1331937567 15331 127.0.0.1 (16 Mar 2012 22:39:27 GMT)
X-Complaints-To: groups-abuse@google.com
NNTP-Posting-Date: Fri, 16 Mar 2012 22:39:27 +0000 (UTC)
Complaints-To: groups-abuse@google.com
Injection-Info: g2g2000vbs.googlegroups.com; posting-host=99.255.196.162; posting-account=Xy5uKgoAAACjOU6-q5ZkGYMKkLBhGhGt
User-Agent: G2/1.0
X-HTTP-UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8)
 AppleWebKit/535.11 (KHTML, like Gecko) Chrome/17.0.963.79 Safari/535.11,gzip(gfe)
Xref: news.mathworks.com comp.soft-sys.matlab:761264

Hi everyone:

I have a large matrix in the form:

a1 =
[1 1 1 1;
1 1 1 NaN;
1 1 NaN NaN;
1 NaN NaN NaN];

and I need to have it each column shift down by the number of NaNs in
that column yielding:

a1New =
[1 NaN NaN NaN;
1 1 NaN NaN;
1 1 1 NaN;
1 1 1 1];

Is there an efficient way to do this?

Cheers,

t.