[Jprogramming] Remove part of rank-2 array
Linda Alvord
lindaalvord at verizon.net
Thu Oct 13 22:13:37 HKT 2011
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: programming-bounces at jsoftware.com
[mailto:programming-bounces at jsoftware.com] 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
<purpleblues13 at googlemail.com> 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
More information about the Programming
mailing list