FreeMat
TRIU Upper Triangular Matrix Function

Section: Array Generation and Manipulations

Usage

Returns the upper triangular matrix of a square matrix. The general syntax for its use is

   y = triu(x)

where x is a square matrix. This returns the upper triangular matrix (i.e.: all elements on or below the diagonal are set to 0). You can also specify a different diagonal using the alternate form

   y = triu(x,n)