Date: Jan 25, 2013 4:34 PM
Author: Adam Chapman
Subject: repeating array elements

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