NimbleThink Posted December 17, 2009 Report Posted December 17, 2009 I have need to replicate elements in an array. The "Interleave 1D Arrays" is not feasible due to: 1) too large a number of replicates (>5) 2) variable number of replicates (345, 625, etc.) I know that a For loop (with a pre-initialized array of size length M x number of replicates N) could work, however I avoid them (for speed) and so came up with the following: Multiply the input array with an array populated with the number of replicates using the Outer Product then reshape from a 2D array back to a 1D array. Any other suggestions? Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.