I've been struggling over this for hours, and just can't seem to figure out a formula for it.

I'm trying to append below, (attach underneath) one matrix to the other.

So for example, for Matrix A:

1 2 3

4 5 6

and Matrix B:

7 8 9

A.Append(B) becomes:

1 2 3

4 5 6

7 8 9

So I've started off by resizing A to the size of both matrices, to get

1 4 2 5 3 6 _ _ _

and then the finished vector should like

1 4 7 2 5 8 3 6 9

so I've worked out to get this I need:

data[8] = b.data[2]

data[5] = b.data[1]

data[2] = b.data[0]

which isn't so bad but im struggling with:

data[7] = data[5]

data[6] = data[4]

data[4] = data[3]

data[3] = data[2]

data[1] = data[1]

data[0] = data[0]

since I need to decrease i by 1 but then 'skip' certain i values, can anyone please give me a hint as to how this would be done?

Thanks in advance!