eig(mat, details)

Gives generalised eigenvalues and vectors of A.

matThe matrix of which the eigenvalues are to be calculated.
detailsIf the transformation matrix is to be calculated and returned. (Defaults to false, otherwise the return type is structure.)
return valueThe vector d of the eigenvalues, or the structre {d:d, s:S} (S is the (generalised) eigenbasis), depending on the parameter 'details'.

Currently works only for diagonalisable matrices (i.e. every eigenvector is an algebraic eigenvector).

When second argument is true, a structure is returned, whose elements are:

eig([1,2,3;2,1,3;2,1,2])
Calculate eigenvectors
s=eig([1,2,3;2,1,3;2,1,2], true) s.s*diag(s.d)*s.s.inv()