I had a fun moment with J earlier tonight. I was contemplating how to sort
a matrix by it's columns and rows while doing the dishes. I sat down and
tried it and it was remarkably easy

/:~ /:~"1 (10 10 $ ?. 100#50)

http://pasteboard.co/2vm2rWOu.png

or a bigger matrix:

viewmat /:~ /:~"1 (500 500 $ ?. 10000#500)

http://pasteboard.co/2vm7CkN2.png

I figure it's old hat, but still wanted to share that I got a kick out of it
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to