Hi, I sort of understand how I transpose a matrix of the form n × m into m × n form
and also how to reshape a matrix from the form n × m into p × q as long as n/q (respectively m*q) are integers.
e.g. how to transform an 8 × 6 matrix into a 4 × 12 matrix ( 8 / 4 = 12 / 6 = 2).
Whether the transformation is done row-wise or column-wise is not really important, so in my attached examples I went for row-wise, i.e. row by row.
I now wish to do the same where the above condition is no longer satisifed, e.g. transforming a 5 × 4 matrix into a 2 x 10 matrix, i.e. 5 / 2 or 10 /4 = 2.5 (or more generalised, into any form, e.g. also a 7 × 3 matrix, acknowledging that the last data point cannot be populated, i.e. would be a zero/REF#! depending on whether this is done via OFFSET or INDEX).
Attached examples.
The first matrix is reshaped as explained above, so there're no problem there.
Below that I try the more general approach, which fails starting at row 2: The first value to be picked up there should obviously be 70 and not (again) 6.
Can somebody support me in changing the formulas accordingly?
It seems that both the working of the row AND column determination need to be changed.
Bookmarks