Eigenvalues and Eigenvectors in MATLAB Last Updated : 25 Jul, 2024 Summarize Comments Improve Suggest changes Share Like Article Like Report Eigenvalues and Eigenvectors are properties of a square matrix.Let A =[a_{ij}]_{N*N} is an N*N matrix, X be a vector of size N*1 and \lambda be a scalar.Then the values X,\lambda satisfying the equation AX=\lambda X are eigenvectors and eigenvalues of matrix A respectively.A matrix of size N*N possess N eigenvaluesEvery eigenvalue corresponds to an eigenvector.Matlab allows the users to find eigenvalues and eigenvectors of matrix using eig() method. Different syntaxes of eig() method are:e = eig(A)[V,D] = eig(A)[V,D,W] = eig(A)e = eig(A,B)Let us discuss the above syntaxes in detail:e = eig(A)It returns the vector of eigenvalues of square matrix A. Matlab % Square matrix of size 3*3 A = [0 1 2; 1 0 -1; 2 -1 0]; disp("Matrix"); disp(A); % Eigenvalues of matrix A e = eig(A); disp("Eigenvalues"); disp(e); Output :[V,D] = eig(A)It returns the diagonal matrix D having diagonals as eigenvalues.It also returns the matrix of right vectors as V.Normal eigenvectors are termed as right eigenvectors.V is a collection of N eigenvectors of each N*1 size(A is N*N size) that satisfies A*V = V*D Matlab % Square matrix of size 3*3 A = [8 -6 2; -6 7 -4; 2 -4 3]; disp("Matrix"); disp(A); % Eigenvalues and right eigenvectors of matrix A [V,D] = eig(A); disp("Diagonal matrix of Eigenvalues"); disp(D); disp("Right eigenvectors") disp(V); Output :[V,D,W] = eig(A)Along with the diagonal matrix of eigenvalues D and right eigenvectors V, it also returns the left eigenvectors of matrix A.A left eigenvector u is a 1*N matrix that satisfies the equation u*A = k*u, where k is a left eigenvalue of matrix A.W is the collection of N left eigenvectors of A that satisfies W'*A = D*W'. Matlab % Square matrix of size 3*3 A = [10 -6 2; -6 7 -4; 2 -4 3]; disp("Matrix :"); disp(A); % Eigenvalues and right and left eigenvectors % of matrix A [V,D,W] = eig(A); disp("Diagonal matrix of Eigenvalues :"); disp(D); disp("Right eigenvectors :") disp(V); disp("Left eigenvectors :") disp(W); Output :e = eig(A,B)It returns the generalized eigenvalues of two square matrices A and B of the same size.A generalized eigenvalue λ and a corresponding eigenvector v satisfy Av=λBv. Matlab % Square matrix A and B of size 3*3 A = [10 -6 2; -6 7 -4; 2 -4 3]; B = [8 6 1; 6 17 2; -1 4 3]; disp("Matrix A:"); disp(A); disp("Matrix B:"); disp(B); % Generalized eigen values % of matrices A and B e = eig(A,B); disp("Generalized eigenvalues :") disp(e); Output : Comment More infoAdvertise with us Next Article Eigenvalues and Eigenvectors in MATLAB M ManikantaBandla Follow Improve Article Tags : Matrix Computer Subject MATLAB DSA Practice Tags : Matrix Similar Reads Applications of Eigenvalues and Eigenvectors Eigenvalues and eigenvectors play a crucial role in a wide range of applications across engineering and science. Fields like control theory, vibration analysis, electric circuits, advanced dynamics, and quantum mechanics frequently rely on these concepts. One key application involves transforming ma 7 min read What is the difference between eigenvalues and eigenvectors? Eigenvalues and eigenvectors are concepts that are used in Linear Algebra which is an important branch of Mathematics and which serves as the basis of many areas of Physics, Engineering and even Computer Science. The eigenvector of the matrix is the non-zero vector which either extends or reduces on 7 min read Eigenspace and Eigenspectrum Values in a Matrix Prerequisites: Mathematics | Eigen Values and Eigen Vectors Matrix Multiplication Null Space and Nullity of a Matrix For a given matrix A the set of all eigenvectors of A associated with an eigenvalue \lambda spans a subspace, which is called the Eigenspace of A with respect to \lambda and is denote 3 min read Find() function in MATLAB The find() function in MATLAB is used to find the indices and values of non-zero elements or the elements which satisfy a given condition. The relational expression can be used in conjunction with find to find the indices of elements that meet the given condition. It returns a vector that contains t 3 min read Creating Function in Files in MATLAB MATLAB is a high-performance language that is used for matrix manipulation, performing technical computations, graph plottings, etc. It stands for Matrix Laboratory. Functions:The function is a set of statements or commands, which take input/s as parameters and return output. We write functions to 2 min read Like