You can also do it from first principles: outer(1:100,1:100,`<`) * m which generalizes nicely to >, <=, >=, !=, etc. -s On 11/21/08, Henrique Dallazuanna <wwwhsd at gmail.com> wrote: > See ?upper.tri and ?lower.tri.