Index   <<   >>

 

Application: Monadic Comma-Bar


   2 3 4⍴⍳24
 0  1  2  3
 4  5  6  7
 8  9 10 11
           
12 13 14 15
16 17 18 19
20 21 22 23

   ⍪ 2 3 4⍴⍳24
 0  1  2  3  4  5  6  7  8  9 10 11
12 13 14 15 16 17 18 19 20 21 22 23

R ← ⍪Y       (Dyalog)
Y may be any array. R is a 2-dimensional matrix of the elements of Y taken in row-major order, preserving the shape of the first dimension of Y if it exists.


Z ← ⍪B       (ISO Standard)
Z is a matrix containing the elements of B. Z is formed by ravelling the subarrays of B along its first axis. For example, if B is a scalar, Z has shape 1 1; if B is a five-element vector, Z has shape 5 1; if B has shape 5 4 3 2,
Z has shape 5 24.


   commabar←{((1↑(⍴⍵),1),×/1↓⍴⍵)⍴⍵}

   commabar 2 3 4⍴⍳24
 0  1  2  3  4  5  6  7  8  9 10 11
12 13 14 15 16 17 18 19 20 21 22 23

   (commabar 'a') ≡ ⍪ 'a'
1