Take a look at each of the results and see what you have got
3{1 2 3 4 #"2 each <x
2010/4/26 Robert O'Boyle <[email protected]>:
> Hi
>
>
>
> I have a matrix, x, which is boxed
>
>
>
> x=. i. 4 6
>
> <x
>
> ------------------┐
>
> │ 0 1 2 3 4 5│
>
> │ 6 7 8 9 10 11│
>
> │12 13 14 15 16 17│
>
> │18 19 20 21 22 23│
>
> L------------------
>
> I want to copy each row of x. Using #, I can do this on the unboxed x matrix
>
>
>
> 1 2 3 4 #"2 x
>
>
>
> 0 1 2 3 4 5
>
> 6 7 8 9 10 11
>
> 6 7 8 9 10 11
>
> 12 13 14 15 16 17
>
> 12 13 14 15 16 17
>
> 12 13 14 15 16 17
>
> 18 19 20 21 22 23
>
> 18 19 20 21 22 23
>
> 18 19 20 21 22 23
>
> 18 19 20 21 22 23
>
>
>
> But I get an unexpected result when I use the verb 'each'.
>
>
>
> 1 2 3 4 #"2 each <x
>
> ------------------T-----------------T-----------------T-----------------┐
>
> │ 0 1 2 3 4 5│ 0 1 2 3 4 5│ 0 1 2 3 4 5│ 0 1 2 3 4 5│
>
> │ 6 7 8 9 10 11│ 0 1 2 3 4 5│ 0 1 2 3 4 5│ 0 1 2 3 4 5│
>
> │12 13 14 15 16 17│ 6 7 8 9 10 11│ 0 1 2 3 4 5│ 0 1 2 3 4 5│
>
> │18 19 20 21 22 23│ 6 7 8 9 10 11│ 6 7 8 9 10 11│ 0 1 2 3 4 5│
>
> │ │12 13 14 15 16 17│ 6 7 8 9 10 11│ 6 7 8 9 10 11│
>
> │ │12 13 14 15 16 17│ 6 7 8 9 10 11│ 6 7 8 9 10 11│
>
> │ │18 19 20 21 22 23│12 13 14 15 16 17│ 6 7 8 9 10 11│
>
> │ │18 19 20 21 22 23│12 13 14 15 16 17│ 6 7 8 9 10 11│
>
> │ │ │12 13 14 15 16 17│12 13 14 15 16 17│
>
> │ │ │18 19 20 21 22 23│12 13 14 15 16 17│
>
> │ │ │18 19 20 21 22 23│12 13 14 15 16 17│
>
> │ │ │18 19 20 21 22 23│12 13 14 15 16 17│
>
> │ │ │ │18 19 20 21 22 23│
>
> │ │ │ │18 19 20 21 22 23│
>
> │ │ │ │18 19 20 21 22 23│
>
> │ │ │ │18 19 20 21 22 23│
>
> L-----------------+-----------------+-----------------+------------------
>
>
>
> Any assistance on this would be appreciated.
>
>
>
> Bob
>
>
>
>
>
>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
--
Björn Helgason, Verkfræðingur
Fornustekkum II
781 Hornafirði,
t-póst: [email protected]
gsm: +3546985532
sími: +3544781286
http://groups.google.com/group/J-Programming
Tæknikunnátta höndlar hið flókna, sköpunargáfa er meistari einfaldleikans
góður kennari getur stigið á tær án þess að glansinn fari af skónum
/|_ .-----------------------------------.
,' .\ / | Með léttri lund verður |
,--' _,' | Dagurinn í dag |
/ / | Enn betri en gærdagurinn |
( -. | `-----------------------------------'
| ) | (\_ _/)
(`-. '--.) (='.'=) ♖♘♗♕♔♙
`. )----' (")_(") ☃☠
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm