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

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.

댓글을 달려면 로그인하십시오.

 채택된 답변

Bruno Luong
Bruno Luong 2022년 4월 20일

0 개 추천

Don't use symbolic variable to build your matrices.

댓글 수: 2

I banned all symbolic variables from my code, but it doesn't look like it changed anything. I still have the error and absurd values.
Bruno Luong
Bruno Luong 2022년 4월 20일
편집: Bruno Luong 2022년 4월 20일
"Error using sym/eig"
implies you have symbolic variable.
If
eig(K\M)
returns "absurd" result perhaps your matrices input is not correct ("I modified some values in the mass matrix" but what?) . But you don't tell us what ther are and why it is absurd. The only absurd thing to me is that you expect useful help from so little information.

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Mathematics에 대해 자세히 알아보기

제품

릴리스

R2022a

질문:

2022년 4월 20일

댓글:

2022년 4월 20일

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by