Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
Скачиваний:
17
Добавлен:
09.02.2015
Размер:
239.1 Кб
Скачать

matlab\matfun – Матричные функции и численная линейная алгебра

Matrix analysis

<norm> - Matrix or vector norm.

NORM Matrix or vector norm.

For matrices...

NORM(X) is the 2-norm of X.

NORM(X,2) is the same as NORM(X).

NORM(X,1) is the 1-norm of X.

NORM(X,inf) is the infinity norm of X.

NORM(X,'fro') is the Frobenius norm of X.

NORM(X,P) is available for matrix X only if P is 1, 2, inf or 'fro'.

For vectors...

NORM(V,P) = sum(abs(V).^P)^(1/P).

NORM(V) = norm(V,2).

NORM(V,inf) = max(abs(V)).

NORM(V,-inf) = min(abs(V)).

See also cond, rcond, condest, normest, hypot.

Overloaded methods:

codistributed/norm

mfilt.norm

adaptfilt.norm

Idmodel/norm

dfilt.norm

Reference page in Help browser

doc norm

<normest> - Estimate the matrix 2-norm.

NORMEST Estimate the matrix 2-norm.

NORMEST(S) is an estimate of the 2-norm of the matrix S.

NORMEST(S,tol) uses relative error tol instead of 1.e-6.

[nrm,cnt] = NORMEST(..) also gives the number of iterations used.

This function is intended primarily for sparse matrices,

although it works correctly and may be useful for large, full

matrices as well. Use NORMEST when your problem is large

enough that NORM takes too long to compute and an approximate

norm is acceptable.

Class support for input S:

float: double, single

See also norm, cond, rcond, condest.

Overloaded methods:

codistributed/normest

Reference page in Help browser

doc normest

<rank> - Matrix rank.

RANK Matrix rank.

RANK(A) provides an estimate of the number of linearly

independent rows or columns of a matrix A.

RANK(A,tol) is the number of singular values of A

that are larger than tol.

RANK(A) uses the default tol = max(size(A)) * eps(norm(A)).

Class support for input A:

float: double, single

Overloaded methods:

gf/rank

xregdesign/rank

rptcp/rank

Reference page in Help browser

doc rank

<det> - Determinant.

DET Determinant.

DET(X) is the determinant of the square matrix X.

Use COND instead of DET to test for matrix singularity.

See also cond.

Overloaded methods:

gf/det

laurmat/det

Reference page in Help browser

doc det

<trace> - Sum of diagonal elements.

TRACE Sum of diagonal elements.

TRACE(A) is the sum of the diagonal elements of A, which is

also the sum of the eigenvalues of A.

Class support for input A:

float: double, single

Reference page in Help browser

doc trace

<null> - Null space.

NULL Null space.

Z = NULL(A) is an orthonormal basis for the null space of A obtained

from the singular value decomposition. That is, A*Z has negligible

elements, size(Z,2) is the nullity of A, and Z'*Z = I.

Z = NULL(A,'r') is a "rational" basis for the null space obtained

from the reduced row echelon form. A*Z is zero, size(Z,2) is an

estimate for the nullity of A, and, if A is a small matrix with

integer elements, the elements of R are ratios of small integers.

The orthonormal basis is preferable numerically, while the rational

basis may be preferable pedagogically.

Example:

A =

1 2 3

1 2 3

1 2 3

Z = null(A);

Computing the 1-norm of the matrix A*Z will be

within a small tolerance

norm(A*Z,1)< 1e-12

ans =

1

null(A,'r') =

-2 -3

1 0

0 1

Class support for input A:

float: double, single

See also svd, orth, rank, rref.

Overloaded methods:

xregpointer/null

sym/null

Reference page in Help browser

doc null

<orth> - Orthogonalization.

ORTH Orthogonalization.

Q = ORTH(A) is an orthonormal basis for the range of A.

That is, Q'*Q = I, the columns of Q span the same space as

the columns of A, and the number of columns of Q is the

rank of A.

Class support for input A:

float: double, single

See also svd, rank, null.

Reference page in Help browser

doc orth

<rref> - Reduced row echelon form.

RREF Reduced row echelon form.

R = RREF(A) produces the reduced row echelon form of A.

[R,jb] = RREF(A) also returns a vector, jb, so that:

r = length(jb) is this algorithm's idea of the rank of A,

x(jb) are the bound variables in a linear system, Ax = b,

A(:,jb) is a basis for the range of A,

R(1:r,jb) is the r-by-r identity matrix.

[R,jb] = RREF(A,TOL) uses the given tolerance in the rank tests.

Roundoff errors may cause this algorithm to compute a different

value for the rank than RANK, ORTH and NULL.

Class support for input A:

float: double, single

See also rank, orth, null, qr, svd.

Reference page in Help browser

doc rref

<subspace> - Angle between two subspaces.

SUBSPACE Angle between subspaces.

SUBSPACE(A,B) finds the angle between two subspaces specified by the

columns of A and B.

If the angle is small, the two spaces are nearly linearly dependent.

In a physical experiment described by some observations A, and a second

realization of the experiment described by B, SUBSPACE(A,B) gives a

measure of the amount of new information afforded by the second

experiment not associated with statistical errors of fluctuations.

Class support for inputs A, B:

float: double, single

Reference page in Help browser

doc subspace

Linear equations

/ and / - Linear equation solution; use "help slash".

Matrix division.

\ Backslash or left division.

A\B is the matrix division of A into B, which is roughly the

same as INV(A)*B , except it is computed in a different way.

If A is an N-by-N matrix and B is a column vector with N

components, or a matrix with several such columns, then

X = A\B is the solution to the equation A*X = B. A warning

message is printed if A is badly scaled or nearly

singular. A\EYE(SIZE(A)) produces the inverse of A.

If A is an M-by-N matrix with M < or > N and B is a column

vector with M components, or a matrix with several such columns,

then X = A\B is the solution in the least squares sense to the

under- or overdetermined system of equations A*X = B. The

effective rank, K, of A is determined from the QR decomposition

with pivoting. A solution X is computed which has at most K

nonzero components per column. If K < N this will usually not

be the same solution as PINV(A)*B. A\EYE(SIZE(A)) produces a

generalized inverse of A.

/ Slash or right division.

B/A is the matrix division of A into B, which is roughly the

same as B*INV(A) , except it is computed in a different way.

More precisely, B/A = (A'\B')'. See \.

./ Array right division.

B./A denotes element-by-element division. A and B

must have the same dimensions unless one is a scalar.

A scalar can be divided with anything.

.\ Array left division.

A.\B. denotes element-by-element division. A and B

must have the same dimensions unless one is a scalar.

A scalar can be divided with anything.

<linsolve> - Linear equation solution with extra control.

LINSOLVE Solve linear system A*X=B.

X = LINSOLVE(A,B) solves the linear system A*X=B using

LU factorization with partial pivoting when A is square,

and QR factorization with column pivoting otherwise.

Warning is given if A is ill conditioned for square matrices

and rank deficient for rectangular matrices.

[X, R] = LINSOLVE(A,B) suppresses these warnings and returns R

the reciprocal of the condition number of A for square matrices,

and the rank of A if A is rectangular.

X = LINSOLVE(A,B,OPTS) solves the linear system A*X=B,

with an appropriate solver determined by the properties of

the matrix A as described by the structure OPTS. The fields of OPTS

must contain logicals. All field values are defaulted to false.

No test is performed to verify whether A possesses such properties.

[X, R] = LINSOLVE(A,B,OPTS) suppresses these warnings and returns R,

the reciprocal of the condition number of A, or the rank of A (depending

on OPTS). See table below for more information.

Below is the list of all possible field names and

their corresponding matrix properties.

Field Name : Matrix Property

------------------------------------------------

LT : Lower Triangular

UT : Upper Triangular

UHESS : Upper Hessenberg

SYM : Real Symmetric or Complex Hermitian

POSDEF : Positive Definite

RECT : General Rectangular

TRANSA : (Conjugate) Transpose of A

Here is a table containing all possible combinations of options:

LT UT UHESS SYM POSDEF RECT TRANSA Output R

----------------------------------------- ----------------

T F F F F T/F T/F condition number

F T F F F T/F T/F condition number

F F T F F F T/F condition number

F F F T T/F F T/F condition number

F F F F F T/F T/F rank

Example:

A = triu(rand(5,3)); x = [1 1 1 0 0]'; b = A'*x;

y1 = (A')\b

opts.UT = true; opts.TRANSA = true;

y2 = linsolve(A,b,opts)

See also mldivide, slash.

Reference page in Help browser

doc linsolve

<inv> - Matrix inverse.

INV Matrix inverse.

INV(X) is the inverse of the square matrix X.

A warning message is printed if X is badly scaled or

nearly singular.

See also slash, pinv, cond, condest, lsqnonneg, lscov.

Overloaded methods:

gf/inv

InputOutputModel/inv

idmodel/inv

uss/inv

umat/inv

ufrd/inv

ndlft/inv

atom/inv

Reference page in Help browser

doc inv

<rcond> - LAPACK reciprocal condition estimator

RCOND LAPACK reciprocal condition estimator.

RCOND(X) is an estimate for the reciprocal of the

condition of X in the 1-norm obtained by the LAPACK

condition estimator. If X is well conditioned, RCOND(X)

is near 1.0. If X is badly conditioned, RCOND(X) is

near EPS.

See also cond, norm, condest, normest.

Overloaded methods:

frd/rcond

Reference page in Help browser

doc rcond

<cond> - Condition number with respect to inversion.

COND Condition number with respect to inversion.

COND(X) returns the 2-norm condition number (the ratio of the

largest singular value of X to the smallest). Large condition

numbers indicate a nearly singular matrix.

COND(X,P) returns the condition number of X in P-norm:

NORM(X,P) * NORM(INV(X),P).

where P = 1, 2, inf, or 'fro'.

Class support for input X:

float: double, single

See also rcond, condest, condeig, norm, normest.

Overloaded methods:

Соседние файлы в папке Библиотеки Matlab