Sometimes an idea takes you someplace unexpected.  A happy accident.

f ?5 5$0

0.580254        0        0         0        0
0.317618 0.887079        0         0        0
0.811079 0.272799 0.663644         0        0
0.500481 0.868608 0.380875   0.67526        0
 0.92362 0.915394 0.637539 0.0688113 0.865864

Linda


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Linda Alvord
Sent: Thursday, October 13, 2011 10:14 AM
To: 'Programming forum'
Subject: Re: [Jprogramming] Remove part of rank-2 array

Or:

   f=: 13 :'y*>:/~i.1{$y'
   f
] * [: >:/~ [: i. 1 { $

  f A

2 0 0
3 4 0
4 5 6

Linda
-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Raul Miller
Sent: Thursday, October 13, 2011 8:57 AM
To: Programming forum
Subject: Re: [Jprogramming] Remove part of rank-2 array

On Thu, Oct 13, 2011 at 8:52 AM, David Vaughan
<[email protected]> wrote:
> I have an array like:
>
> 2 3 4
> 3 4 5
> 4 5 6
>
> but I want to delete the upper right corner like so:
>
> 2 0 0
> 3 4 0
> 4 5 6

   A=:+/~1+i.3
   (* >:/&i./@$) A
2 0 0
3 4 0
4 5 6

-- 
Raul
----------------------------------------------------------------------
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

Reply via email to