I'm not sure that elegant is the word I would use for this.

f=: 13 :'(($i.y)#"1,.x),i.y'
    f
(([: $ [: i. ]) #"1 [: ,. [) , [: i. ]

  1 2 3 f 5
1 1 1 1 1
2 2 2 2 2
3 3 3 3 3
0 1 2 3 4

Linda      

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of R.E. Boss
Sent: Saturday, June 07, 2014 3:58 AM
To: Programming forum
Subject: [Jprogramming] laminating atoms

'a b'=.3;&i. 5

 

   a ([:|:,"1 0) b

0 0 0 0 0

1 1 1 1 1

2 2 2 2 2

0 1 2 3 4

 

is what I want, but isn't there a more elegant way?

 

 

R.E. Boss

 

(Add your info to  <http://www.jsoftware.com/jwiki/Community/Demographics>
http://www.jsoftware.com/jwiki/Community/Demographics )

 

 

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to