Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Circshift applied to columns by different amounts
Replies: 5   Last Post: Mar 16, 2012 11:53 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Tyler

Posts: 78
Registered: 7/20/08
Circshift applied to columns by different amounts
Posted: Mar 16, 2012 6:33 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

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.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2013. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.