08-03-2011 04:17 PM
I'm looking for a way to swap a user-defined length of elements in a 2-dimensional array between rows. All of my efforts so far only take the elements and move them within the same row.
Basically I have a 2d array with 2 rows, and I want to take a few of the elements from one and put them in the other, getting a new array that has elements of both. This needs to be expandable to any number of rows.
Thanks for your help.
Solved! Go to Solution.
08-03-2011 04:39 PM
A quick example-
This will take Length elements from Start index and reverse the row that tha data is in. e.g Start 1 length 2
0 1 2 3 0 3 4 3
4 5 6 7 Maps to 4 9 0 7
8 9 0 1 8 5 6 1
2 3 4 5 2 1 2 5
Maybe not exactly what you want but some food for thought. A Z delay FBN would allow shifting rather than reversal
08-03-2011 04:46 PM
I'm sorry I'm not a very advanced user, can you explain in a bit more detail how something like that might be done?
08-03-2011 06:35 PM
Oh, He77!
I, of course, meant to ATTACH the example That is on my work PC I'll post it first thig in the AM
Sorry.
08-03-2011 11:19 PM
Something like this? (see attached)
08-04-2011 07:13 AM
pretty close. I did it with nested IPE structures I'll post the example in an hour or so
08-04-2011 08:09 AM
Like this... Simple.
08-04-2011 08:51 AM - edited 08-04-2011 08:55 AM
@ADrexelDragon wrote:
Like this... Simple.
The OP did require the ability to expand to additional rows.
This example shifts row data down by "Shift"
08-04-2011 11:22 AM
Thanks I should be able to do a lot with your solution, Jeff. I've never used IPE structures before. I'll start figuring these out.
08-04-2011 11:30 AM
Here is what I came up with. It allows for single element swapping.