My eig function worked once and then broke
이전 댓글 표시
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
Christine Tobler
2022년 4월 20일
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.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Mathematics에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!