istriu

Tests whether a matrix is upper triangular.

Category: Mathematics > Linear Algebra

Syntax

tf = istriu(A)

True if all entries below the main diagonal are zero.

Description

The diagonal and everything above it are unrestricted. The result of chol, qr and lu (the U factor) satisfies this test. Upper triangular systems are solved by back substitution.

Input arguments

A
Numeric or logical matrix.

Output arguments

tf
Logical scalar.

Example

Upper and not upper

istriu([1 2; 0 3])
istriu([1 2; 1 3])
Output
ans = logical
   1
ans = logical
   0

See also

istril isdiag triu isbanded