Skip to content
Prev 377047 / 398502 Next

(no subject)

Jeremie's suggestion of course will fail if some of the off-diagonal
elements are the same as those on the diagonals.

The request doesn't make a lot of sense to me, but if "m" is the matrix,

 m[row(z) != col(z)]

reliably extracts the vector of non-diagonal entries, which can then be
dimensioned as desired.
Or upper.tri() and lower.tri() can be used to separately extract the upper
and lower triangle entries via logical indexing.

Cheers,
Bert


Bert Gunter

"The trouble with having an open mind is that people keep coming along and
sticking things into it."
-- Opus (aka Berkeley Breathed in his "Bloom County" comic strip )


On Sat, Oct 20, 2018 at 8:48 AM Jeremie Juste <jeremiejuste at gmail.com>
wrote: