Skip to content
Prev 32388 / 398513 Next

extract half a matrix

On Thu, 22 May 2003, Tord Snall wrote:

            
In addition to the solution suggested by other people there are built-in
functions upper.tri and lower.tri for doing this sort of thing, so

  x[upper.tri(x)]


	-thomas