Help Error using eig Input to EIG must not contain NaN or Inf
이전 댓글 표시
Error using eig
Input to EIG must not contain NaN or Inf.
Error in composite_twoshaft_spurgear (line 450)
w=sort(abs(imag(eig(EF))));
E=[o,-(MM1+MM2+MMd);(MM1+MM2+MMd),(CC1+CC2+CCB1+CCB2)+(Oma1*(GG1+GGd1)+Oma2*(GG2+GGd2))];
F=[(MM1+MM2+MMd),o;o,(KK1+KK2+KKB1+KKB2)];
EF=-inv(E)*F;
w=sort(abs(imag(eig(EF))));
ww(:,n)=w;
[C,D]=eig(EF);
댓글 수: 7
KSSV
2017년 7월 9일
To calculate eigenvalues of a given matrix, there must be no Nans or inf. Your matrix EF have Nan's . Check it.
Walter Roberson
2017년 7월 9일
Use
EF =-E\F
However your matrix might simply not be invertible
Walter Roberson
2017년 7월 9일
If your values have multiple inf, or if one contains inf and the other contst least one 0, or if your values for E are all 0, then you will get nan results. If your E is not invertible otherwise then I do not recall if you get inf or nan as the result.
Walter Roberson
2017년 7월 9일
Note to respond, click on "Comment on this" not on Flag. Flag is for pointing out a problem to the moderators such as if you notice a spam message.
Cheng Xu Feng
2017년 7월 9일
KSSV
2017년 7월 9일
So problem is with MM1 etc values. You have to show us the complete code to solve the problem.
Walter Roberson
2017년 7월 9일
Please show the output of
rcond(E)
rank(E)
rank(F)
nnz(~isfinite(E))
nnz(~isfinite(F))
답변 (1개)
Cheng Xu Feng
2017년 7월 10일
0 개 추천
댓글 수: 2
Walter Roberson
2017년 7월 10일
How do you know they are wrong?
What is your current code? What are
rcond(E)
rank(E)
rank(F)
nnz(~isfinite(E))
nnz(~isfinite(F))
laiche zeghdi
2023년 10월 18일
i have same problem . can you help me
1) An error occurred while running the simulation and the simulation was terminated
Caused by: Input to EIG must not contain NaN or Inf.
2) Cannot create variable 'if' in workspace Caused by:
ASSIGNIN cannot assign to variables with the same name as a MATLAB keyword
카테고리
도움말 센터 및 File Exchange에서 Numeric Types에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!