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

Voronoi vertices, where numv is the number of vertices and ndim is the

dimension of the space where the points reside. R is a vector cell array

of length(DR.X), representing the Voronoi cell associated with each

point. Hence, the Voronoi region associated with the i'th point,

DT.X(i) is R{i}.

For 2-D, vertices in R{i} are listed in adjacent order, i.e. connecting

them will generate a closed polygon (Voronoi diagram). For 3-D

the vertices in R{i} are listed in ascending order.

The Infinite Vertex

The Voronoi regions associated with points that lie on the convex hull

of DT.X are unbounded. Bounding edges of these regions radiate to

infinity. The vertex at infinity is represented by the first vertex in V.

Example: Compute the Voronoi Diagram of a set of points

X = [ 0.5 0

0 0.5

-0.5 -0.5

-0.2 -0.1

-0.1 0.1

0.1 -0.1

0.1 0.1 ]

dt = DelaunayTri(X)

[V,R] = voronoiDiagram(dt)

See also DelaunayTri, voronoi

Reference page in Help browser

doc DelaunayTri/voronoiDiagram

Polynomials

<roots> - Find polynomial roots.

ROOTS Find polynomial roots.

ROOTS(C) computes the roots of the polynomial whose coefficients

are the elements of the vector C. If C has N+1 components,

the polynomial is C(1)*X^N + ... + C(N)*X + C(N+1).

Note: Leading zeros in C are discarded first. Then, leading relative

zeros are removed as well. That is, if division by the leading

coefficient results in overflow, all coefficients up to the first

coefficient where overflow occurred are also discarded. This process is

repeated until the leading coefficient is not a relative zero.

Class support for input c:

float: double, single

See also poly, residue, fzero.

Overloaded methods:

gf/roots

localpoly/roots

Reference page in Help browser

doc roots

<poly> - Convert roots to polynomial.

POLY Convert roots to polynomial.

POLY(A), when A is an N by N matrix, is a row vector with

N+1 elements which are the coefficients of the

characteristic polynomial, DET(lambda*EYE(SIZE(A)) - A) .

POLY(V), when V is a vector, is a vector whose elements are

the coefficients of the polynomial whose roots are the

elements of V . For vectors, ROOTS and POLY are inverse

functions of each other, up to ordering, scaling, and

roundoff error.

ROOTS(POLY(1:20)) generates Wilkinson's famous example.

Class support for inputs A,V:

float: double, single

See also roots, conv, residue, polyval.

Overloaded methods:

sym/poly

Reference page in Help browser

doc poly

<polyval> - Evaluate polynomial.

POLYVAL Evaluate polynomial.

Y = POLYVAL(P,X) returns the value of a polynomial P evaluated at X. P

is a vector of length N+1 whose elements are the coefficients of the

polynomial in descending powers.

Y = P(1)*X^N + P(2)*X^(N-1) + ... + P(N)*X + P(N+1)

If X is a matrix or vector, the polynomial is evaluated at all

points in X. See POLYVALM for evaluation in a matrix sense.

[Y,DELTA] = POLYVAL(P,X,S) uses the optional output structure S created

by POLYFIT to generate prediction error estimates DELTA. DELTA is an

estimate of the standard deviation of the error in predicting a future

observation at X by P(X).

If the coefficients in P are least squares estimates computed by

POLYFIT, and the errors in the data input to POLYFIT are independent,

normal, with constant variance, then Y +/- DELTA will contain at least

50% of future observations at X.

Y = POLYVAL(P,X,[],MU) or [Y,DELTA] = POLYVAL(P,X,S,MU) uses XHAT =

(X-MU(1))/MU(2) in place of X. The centering and scaling parameters MU

are optional output computed by POLYFIT.

Example:

Evaluate the polynomial p(x) = 3x^2+2x+1 at x = 5,7, and 9:

p = [3 2 1];

polyval(p,[5 7 9])%

Class support for inputs P,X,S,MU:

float: double, single

See also polyfit, polyvalm.

Overloaded methods:

gf/polyval

Reference page in Help browser

doc polyval

<polyvalm> - Evaluate polynomial with matrix argument.

POLYVALM Evaluate polynomial with matrix argument.

Y = POLYVALM(P,X), when P is a vector of length N+1 whose elements

are the coefficients of a polynomial, is the value of the

polynomial evaluated with matrix argument X. X must be a

square matrix.

Y = P(1)*X^N + P(2)*X^(N-1) + ... + P(N)*X + P(N+1)*I

Class support for inputs p, X:

float: double, single

See also polyval, polyfit.

Reference page in Help browser

doc polyvalm

<residue> - Partial-fraction expansion (residues).

RESIDUE Partial-fraction expansion (residues).

[R,P,K] = RESIDUE(B,A) finds the residues, poles and direct term of

a partial fraction expansion of the ratio of two polynomials B(s)/A(s).

If there are no multiple roots,

B(s) R(1) R(2) R(n)

---- = -------- + -------- + ... + -------- + K(s)

A(s) s - P(1) s - P(2) s - P(n)

Vectors B and A specify the coefficients of the numerator and

denominator polynomials in descending powers of s. The residues

are returned in the column vector R, the pole locations in column

vector P, and the direct terms in row vector K. The number of

poles is n = length(A)-1 = length(R) = length(P). The direct term

coefficient vector is empty if length(B) < length(A), otherwise

length(K) = length(B)-length(A)+1.

If P(j) = ... = P(j+m-1) is a pole of multplicity m, then the

expansion includes terms of the form

R(j) R(j+1) R(j+m-1)

-------- + ------------ + ... + ------------

s - P(j) (s - P(j))^2 (s - P(j))^m

[B,A] = RESIDUE(R,P,K), with 3 input arguments and 2 output arguments,

converts the partial fraction expansion back to the polynomials with

coefficients in B and A.

Warning: Numerically, the partial fraction expansion of a ratio of

polynomials represents an ill-posed problem. If the denominator

polynomial, A(s), is near a polynomial with multiple roots, then

small changes in the data, including roundoff errors, can make

arbitrarily large changes in the resulting poles and residues.

Problem formulations making use of state-space or zero-pole

representations are preferable.

Class support for inputs B,A,R:

float: double, single

See also poly, roots, deconv.

Reference page in Help browser

doc residue

<polyfit> - Fit polynomial to data.

POLYFIT Fit polynomial to data.

P = POLYFIT(X,Y,N) finds the coefficients of a polynomial P(X) of

degree N that fits the data Y best in a least-squares sense. P is a

row vector of length N+1 containing the polynomial coefficients in

descending powers, P(1)*X^N + P(2)*X^(N-1) +...+ P(N)*X + P(N+1).

[P,S] = POLYFIT(X,Y,N) returns the polynomial coefficients P and a

structure S for use with POLYVAL to obtain error estimates for

predictions. S contains fields for the triangular factor (R) from a QR

decomposition of the Vandermonde matrix of X, the degrees of freedom

(df), and the norm of the residuals (normr). If the data Y are random,

an estimate of the covariance matrix of P is (Rinv*Rinv')*normr^2/df,

where Rinv is the inverse of R.

[P,S,MU] = POLYFIT(X,Y,N) finds the coefficients of a polynomial in

XHAT = (X-MU(1))/MU(2) where MU(1) = MEAN(X) and MU(2) = STD(X). This

centering and scaling transformation improves the numerical properties

of both the polynomial and the fitting algorithm.

Warning messages result if N is >= length(X), if X has repeated, or

nearly repeated, points, or if X might need centering and scaling.

Class support for inputs X,Y:

float: double, single

See also poly, polyval, roots, lscov.

Reference page in Help browser

doc polyfit

<polyder> - Differentiate polynomial.

POLYDER Differentiate polynomial.

POLYDER(P) returns the derivative of the polynomial whose

coefficients are the elements of vector P.

POLYDER(A,B) returns the derivative of polynomial A*B.

[Q,D] = POLYDER(B,A) returns the derivative of the

polynomial ratio B/A, represented as Q/D.

Class support for inputs u, v:

float: double, single

See also polyint, conv, deconv.

Reference page in Help browser

doc polyder

<polyint> - Integrate polynomial analytically.

POLYINT Integrate polynomial analytically.

POLYINT(P,K) returns a polynomial representing the integral

of polynomial P, using a scalar constant of integration K.

POLYINT(P) assumes a constant of integration K=0.

Class support for inputs p, k:

float: double, single

See also polyder, polyval, polyvalm, polyfit.

Reference page in Help browser

doc polyint

<conv> - Multiply polynomials.

CONV Convolution and polynomial multiplication.

C = CONV(A, B) convolves vectors A and B. The resulting vector is

length MAX([LENGTH(A)+LENGTH(B)-1,LENGTH(A),LENGTH(B)]). If A and B are

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