My eig function worked once and then broke
Show older comments
Hello everyone,
I am currently trying to solve a vibrant system, and I need its eigenvalues and eigenvectors. I so used the eig() function, as following:
[EigVec, EigVal] = eig(K\M, 'vector') % K the stiffness matrix, M the mass matrix
I tried it once and got the exact right results. I modified some values in the mass matrix and now this line isn't working anymore. I get the following error:
Error using sym/eig
Too many input arguments.
Error in Homework2 (line 347)
[EigVect, EigVal] = eig(K\M, 'vector');
I also tried:
[EigVec, EigVal] = eig(K\M)
And now I get absurd values.
Any ideas of what happened?
1 Comment
Christine Tobler
on 20 Apr 2022
It sounds like originally your matrices didn't contain symbolic variables, so the eig command accepted the 'vector' option (eig for symbolic variables doesn't accept any option strings). Then you changed M so that it's now a symbolic variable - and those have quite different behavior, since it's not numerical calculation anymore but symbolic.
Can't really tell more since I don't know what you mean by absurd values, or what you expect in terms of symbolic calculation (for example, is M a specific number just in stored symbolically, or does it contain symbolic unknowns)?
We really need reproduction steps of what K and M are, and what you're hoping to compute, to help any more.
Accepted Answer
More Answers (0)
Categories
Find more on Mathematics in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!