in reply to Converting Arrays into Matrix

Have you tried to sort your vectors before combining them? That should solve your issue ... (being a kind of the "look forward" you were asking for)

HTH, Rata

Update: Sorting (of course) changes the order of the elements (that made the proposed solution so elegant ;-) ... when proposing it I wasn't aware of a requirement to preserve the order ... so with the clarification below the simple solution won't work ...

Replies are listed 'Best First'.
Re^2: Converting Arrays into Matrix
by janDD (Acolyte) on Apr 26, 2011 at 07:15 UTC
    Hi,
    well, what exactly do you mean by "sorting"? The order of the entries must be preserved, e.g.
    ['A','C','B'] ne ['A','B','C']
    So it means that the result of the above should be
    A A C B B C
    or
    A A B C C B
    If I understood you correctly, sorting would result in
    A A B B C C
    Or not? This I don't want ;P
    Jan