Mu Analysis and Synthesis Toolbox | ![]() ![]() |
Calculate eigenvalues and eigenvectors of CONSTANT and VARYING matrices
Syntax
evals = veig(matin) [evecs,evals] = veig(matin) [evecs,evals] = veig(matin,'nonbalance') [evecs,evals] = veig(mat1,mat2)
Description
veig
is identical to MATLAB's command eig
, but works on VARYING matrices. veig
solves for the eigenvalues (evals
) and optionally the eigenvectors (evecs) of the input matrix matin
. veig
works only on square CONSTANT or VARYING matrices. Depending on the input arguments, the following operations are performed:
evals
= veig
(matin
) returns a VARYING vector evals
containing the eigenvalues of the VARYING matrix matin
for each independent variable.
[evecs,evals]
= veig
(matin
) returns the VARYING diagonal matrix evals
and a square VARYING matrix evecs whose columns are the corresponding eigenvectors for each independent variable.
[evecs,evals]
= veig(matin,'nobalance')
is the same as the above command without performing a preliminary balancing step. Balancing a matrix, which has very small entries due to round off error, can lead to incorrect eigenvectors.
[evecs,evals]
= veig
(mat1
,mat2
) returns a VARYING diagonal matrix of generalized eigenvalues evals
and the corresponding values of generalized right eigenvectors evecs
associated with each independent variable. mat1
and mat2
can be CONSTANT or VARYING matrices. If either is CONSTANT, then that same matrix is used in the generalized eigenvalue solution for each independent variable. If they are both VARYING matrices, then they must have the same independent variables.
Examples
Create a 2 x 2 random VARYING matrix and find its eigenvalues.
see(matin) 2 rows 2 columns iv = 0.1 0.9304 0.5269 0.8462 0.0920 iv = 0.4 0.6539 0.7012 0.4160 0.9103 evals = veig(matin); see(evals) 2 rows1 column iv = 0.1 1.2996 -0.2772 iv = 0.4 0.2270 1.3372
mat1
=matin
;mat2
=vpck
([4*eye(2);3*eye(2)],[.1 .4]); [evecs,evals
] =veig
(mat1
,mat2
); see(evecs) 2 rows 2 columns iv = 0.1 0.8190 -0.3999 0.5738 0.9166 iv = 0.4 0.8542 0.7162 -0.5200 0.6979 see(evals
) 2 rows 2 columns iv = 0.1 0.3249 0 0 -0.0693 iv = 0.4 0.0757 0 0 0.4457
Algorithm
veig
calls the MATLAB eig
command.
See Also
eig
, indvcmp
, svd
, vsvd
, vpoly
, vroots
![]() | vebe | veval | ![]() |