[Jprogramming] Remove part of rank-2 array
Raul Miller
rauldmiller at gmail.com
Thu Oct 13 21:56:19 HKT 2011
A
2 3 4
3 4 5
4 5 6
$A
3 3
;/@$ A
┌─┬─┐
│3│3│
└─┴─┘
;&i./@$ A
┌─────┬─────┐
│0 1 2│0 1 2│
└─────┴─────┘
0 1 2 >:/ 0 1 2
1 0 0
1 1 0
1 1 1
A * 0 1 2 >:/ 0 1 2
2 0 0
3 4 0
4 5 6
Does this help?
--
Raul
On Thu, Oct 13, 2011 at 9:48 AM, David Vaughan
<purpleblues13 at googlemail.com> wrote:
> How does that work? Using fndisplay, it suggests that it's equivalent to
>
> (* $) A
>
> On 13 Oct 2011, at 13:56, Raul Miller wrote:
>
>> 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
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
More information about the Programming
mailing list