]A=:?(2#>:?8)$8
7 7 0 6 6 5 5
5 3 2 4 0 1 0
2 2 7 2 6 3 2
2 4 3 5 7 3 4
6 0 1 4 6 2 0
2 0 4 1 4 1 2
7 3 5 4 3 7 3
   
   f=: 13 :'0{"1(|i.#y)|."0 1 y'

   f A
7 3 7 5 6 1 3
    
   f 
0 {"1 ] |."0 1~ [: | [: i. #
   
Linda

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Tom Arneson
Sent: Tuesday, March 05, 2013 10:12 PM
To: [email protected]
Subject: [Jprogramming] extacting the main diagonal of a square matrix

I want to create a list containing the main diagonal elements of a square
matrix. Any suggestions?

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

Reply via email to