Column 1 replaced by row 2:
1 2 (];(({:@[{|:@])`({...@[)`])}&.|:) i.4 4
+-----------+-----------+
| 0 1 2 3| 0 8 2 3|
| 4 5 6 7| 4 9 6 7|
| 8 9 10 11| 8 10 10 11|
|12 13 14 15|12 11 14 15|
+-----------+-----------+
R.E. Boss
-----Oorspronkelijk bericht-----
Van: [email protected] [mailto:programming-
[email protected]] Namens Matthew Brand
Verzonden: woensdag 4 februari 2009 10:50
Aan: Programming forum
Onderwerp: Re: [Jprogramming] replacing a column by a row in a table
Does this do it?
i. 4 4
0 1 2 3
4 5 6 7
8 9 10 11
12 13 14 15
(1 { i. 4 4) (2)} &.|: i. 4 4
0 1 4 3
4 5 5 7
8 9 6 11
12 13 7 15
I cannot work out how to do it with:
x (v0`v1`v2)} y ↔ (x v0 y) (x v1 y)} (x v2 y)(v0`v1`v2)} y↔(v1 y)} (v2
y)(v1`v2)}
y↔(v1 y)} (v2 y)
On Wed, Feb 4, 2009 at 9:23 AM, adam dunne <[email protected]> wrote:
> Given a square table a=.i.4 4 is it possible, in one line, to replace
>
> Column 1 with row 2, using a gerund or directly. I seem to get rank
errors.
>
>
>
> -Adam Dunne
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm