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: repeating array elements
Replies: 5   Last Post: Jan 26, 2013 10:49 AM

Advanced Search

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

Posts: 170
Registered: 1/12/09
repeating array elements
Posted: Jan 25, 2013 4:34 PM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Can anybosy think of a fast way to do coppy each element of an array n times row or column wise?

For example, changing the array

1 2 3
4 5 6

to

1 1 2 2 3 3
1 1 2 2 3 3
4 4 5 5 6 6
4 4 5 5 6 6

I'm struggling to think of a way to vectorise this.

If anybody could help I'd be very greatful



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

[Privacy Policy] [Terms of Use]

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