In: Advanced Math
I need a user developed "eig" function (copy of already developed eig function from matlab) without using too much higher order math (matrix multiplication, cross and dot products and elementary row operations are all kosher) to do so, in matlab. without the use of a toolbox. if anyone can help me it would be appreciated.
e = eig(A)
[V,D] = eig(A)
[V,D,W] = eig(A)
e = eig(A,B)
[V,D] = eig(A,B)
[V,D,W] = eig(A,B)
[ ___ ] = eig(A,balanceOption)
[ ___ ] = eig(A,B,algorithm)
[ ___ ] = eig(___,eigvalOption)
Description
e = eig(A) returns a column vector containing the eigenvalues of square matrix A.
[V,D] = eig(A) returns diagonal matrix D of eigenvalues and matrix V whose columns are the corresponding right eigenvectors, so that A*V = V*D.
[V,D,W] = eig(A) also returns full matrix W whose columns are the corresponding left eigenvectors, so that W'*A = D*W'.
The eigenvalue problem is to determine the solution to the equation Av = λv, where A is an n-by-n matrix, v is a column vector of length n, and λ is a scalar. The values of λ that satisfy the equation are the eigenvalues. The corresponding values of v that satisfy the equation are the right eigenvectors. The left eigenvectors, w, satisfy the equation w’A = λw’.
e = eig(A,B) returns a column vector containing the generalized eigenvalues of square matrices A and B.
[V,D] = eig(A,B) returns diagonal matrix D of generalized eigenvalues and full matrix V whose columns are the corresponding right eigenvectors, so that A*V = B*V*D.
[V,D,W] = eig(A,B) also returns full matrix W whose columns are the corresponding left eigenvectors, so that W'*A = D*W'*B.
The generalized eigenvalue problem is to determine the solution to the equation Av = λBv, where A and B are n-by-n matrices, v is a column vector of length n, and λ is a scalar. The values of λ that satisfy the equation are the generalized eigenvalues. The corresponding values of v are the generalized right eigenvectors. The left eigenvectors, w, satisfy the equation w’A = λw’B.
[___] = eig(A,balanceOption), where balanceOption is 'nobalance', disables the preliminary balancing step in the algorithm. The default for balanceOption is 'balance', which enables balancing. The eig function can return any of the output arguments in previous syntaxes.
[___] = eig(A,B,algorithm), where algorithm is 'chol', uses the Cholesky factorization of B to compute the generalized eigenvalues. The default for algorithmdepends on the properties of A and B, but is generally 'qz', which uses the QZ algorithm.
If A is Hermitian and B is Hermitian positive definite, then the default for algorithm is 'chol'.
[ ___ ] = eig(___,eigvalOption) returns the eigenvalues in the form specified by eigvalOption using any of the input or output arguments in previous syntaxes. Specify eigvalOption as 'vector' to return the eigenvalues in a column vector or as 'matrix' to return the eigenvalues in a diagonal matrix.