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.

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

orth

Orthonormal basis for range of matrix

Syntax

Description

example

Q = orth(A) returns an orthonormal basis for the range of A. The columns of Q are vectors, which span the range of A. The number of columns in Q is equal to the rank of A.

Examples

collapse all

Calculate and verify the orthonormal basis vectors for the range of a full rank matrix.

Define a matrix and find the rank.

A = [1 0 1;-1 -2 0; 0 1 -1];
r = rank(A)
r =

     3

Since A is a square matrix of full rank, the orthonormal basis calculated by orth(A) matches the matrix U calculated in the singular value decomposition, [U,S] = svd(A,'econ'). This is because the singular values of A are all nonzero.

Calculate the orthonormal basis for the range of A using orth.

Q = orth(A)
Q =

   -0.1200   -0.8097    0.5744
    0.9018    0.1531    0.4042
   -0.4153    0.5665    0.7118

The number of columns in Q is equal to rank(A). Since A is of full rank, Q and A are the same size.

Verify that the basis, Q, is orthogonal and normalized within a reasonable error range.

E = norm(eye(r)-Q'*Q,'fro')
E =

   9.6228e-16

The error is on the order of eps.

Calculate and verify the orthonormal basis vectors for the range of a rank deficient matrix.

Define a singular matrix and find the rank.

A = [1 0 1; 0 1 0; 1 0 1];
r = rank(A)
r =

     2

Since A is rank deficient, the orthonormal basis calculated by orth(A) matches only the first r = 2 columns of matrix U calculated in the singular value decomposition, [U,S] = svd(A,'econ'). This is because the singular values of A are not all nonzero.

Calculate the orthonormal basis for the range of A using orth.

Q = orth(A)
Q =

   -0.7071         0
         0    1.0000
   -0.7071         0

Since A is rank deficient, Q contains one fewer column than A.

Input Arguments

collapse all

Input matrix, specified as a scalar, vector, or matrix.

Data Types: single | double
Complex Number Support: Yes

More About

collapse all

Range

The column space, or range, of a matrix A is the collection of all linear combinations of the columns of A. Any vector, b, that is a solution to the linear equation, A*x = b, is included in the range of A since you can also write it as a linear combination of the columns of A.

Rank

The rank of a matrix is equal to the dimension of the range.

Algorithms

orth is obtained from U in the singular value decomposition, [U,S] = svd(A,'econ'). If r = rank(A), the first r columns of U form an orthonormal basis for the range of A.

See Also

| |

Introduced before R2006a


Was this topic helpful?