[Jprogramming] Promoting a vector to a matrix (changing rank)

Alex Giannakopoulos aegean at blueyonder.co.uk
Tue Dec 11 17:20:05 UTC 2012


Is there a better way (rhetorical question) to promote an n-element vector,
i.e. of of shape N to a single row matrix of shape (1 N) ?
The best I have come up with so far is:
   v2m =. ] $~ 1,$

I have read up on m"n in the Dictionary, but can't make much sense of it.


More information about the Programming mailing list