On Fri, Aug 7, 2009 at 6:58 AM, Andrea Ambu<[email protected]> wrote:
> z=:p:i.5
> z*/z
> 4 6 10 14 22
> 6 9 15 21 33
> 10 15 25 35 55
> 14 21 35 49 77
> 22 33 55 77 121
>
> what I'd need from this matrix is an array containing the elements on
> its high (or low) triangle, diagonal included, as the rest are
> duplicated items. Any good way to do this?
~.,*/~p:i.5
4 6 10 14 22 9 15 21 33 25 35 55 49 77 121
;(<@*{.)\. p:i.5
4 6 10 14 22 9 15 21 33 25 35 55 49 77 121
There are probably others.
--
Raul
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm