Beautiful. The insight of splitting in 2 by 1 submatrices lead into a more 
compact and elegant code than what I had.

Thanks Henry.
________________________________
From: Programming <[email protected]> on behalf of Henry 
Rich <[email protected]>
Sent: Wednesday, December 11, 2019 7:09 PM
To: [email protected] <[email protected]>
Subject: Re: [Jprogramming] Submatrices

   ({. ,.&.> }.)"1@:((1 1,:2 1)&(<;._3)) a

Henry Rich

On 12/11/2019 6:43 PM, Nimp O wrote:
> Hello everyone,
>
>
> Given
> ]a=: 3 4 $ 1 1 1 _1 4 2 1 _1 9 3 1 1
>
>
> 1 1 1 _1
>
> 4 2 1 _1
>
> 9 3 1 1
>
> I want to find the submatrices:
>
>     f a
> ┌───┬───┬────┐
> │1 1│1 1│1 _1│
> │4 2│4 1│4 _1│
> ├───┼───┼────┤
> │4 2│4 1│4 _1│
> │9 3│9 1│9  1│
> └───┴───┴────┘
>
> I have a quite lengthy solution for this task.
> I was wondering if anyone can come up with something more J-like and elegant 
> than what I have.
>
> Thanks.
>
>
>
> ----------------------------------------------------------------------
> 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