MATLAB Function Reference Previous page   Next Page
triu

Upper triangular part of a matrix

Syntax

Description

U = triu(X) returns the upper triangular part of X.

U = triu(X,k) returns the element on and above the kth diagonal of X. k = 0 is the main diagonal, k > 0 is above the main diagonal, and k < 0 is below the main diagonal.

Examples

See Also

diag, tril


Previous page  trisurf true Next page

© 1994-2005 The MathWorks, Inc.