i have [v,d] = eig(k,m), how do i solve for its eigenvalues, eigenvectors and mode shapes in matlab

After executing the following command

main.m
[v,d] = eig(k,m)
17 chars
2 lines

d will be a diagonal matrix whose elements are the eigenvalues of the system, and v will be a matrix containing the corresponding eigenvectors as its columns.

To extract the eigenvalues, use the diag function to extract the diagonal matrix:

eigenvalues = diag(d);
23 chars
2 lines

To extract individual eigenvectors, you can index the v matrix:

eigenvector_one = v(:,1);
26 chars
2 lines

To compute the mode shapes, you need to normalize the eigenvectors for mass:

mode_shape_one = eigenvector_one / sqrt(eigenvector_one' * m * eigenvector_one);
81 chars
2 lines

You can repeat this for each eigenvector to obtain all the mode shapes.

Note that the eigenvectors are only unique up to a scalar multiple, so different normalization methods may be used depending on the context.

gistlibby LogSnag