Documentation

This is machine translation

Translated by Microsoft
Mouse over text to see original. Click the button below to return to the English verison of the page.

我们为许可用户提供了部分翻译好的中文文档。您只需登录便可查阅这些文档

tril

Lower triangular part of matrix

Syntax

L = tril(X)
L = tril(X,k)

Description

L = tril(X) returns the lower triangular part of X.

L = tril(X,k) returns the elements on and below 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

tril(ones(4,4),-1)

ans =

    0    0    0    0
    1    0    0    0
    1    1    0    0
    1    1    1    0

See Also

|

Introduced before R2006a

Was this topic helpful?