필터 지우기
필터 지우기

how can I avoid this error: Error using eig EIG did not converge.

조회 수: 7 (최근 30일)
mim
mim 2013년 7월 5일
댓글: Jan 2017년 3월 21일
I want to find eigenvalu and eigenvector using "eig" function in matlab, but sometimes I get this error:
Error using eig EIG did not converge.
how can I avoid this error or what can I do the code run again automatically if this error happens?

채택된 답변

Jan
Jan 2013년 7월 5일
Are you looking for TRY/CATCH?
  댓글 수: 2
mim
mim 2013년 7월 5일
what's that? and how it can help me?
Jan
Jan 2017년 3월 21일
You explained, that your code fails sometimes. Then including the failing command in TRY/CATCH allows to run a fallback method or some error handling:
try
[V, D] = eig(X);
catch ME
warning(ME.message);
[V,D] = EIG(X, 'nobalance'); % For example
end
It depends on your calculations, if the problem can be avoided or what "automatic" can help get the wanted result. Without knowing any details about your code, I can suggest only a general strategy.

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

추가 답변 (1개)

Marco Gambacciani
Marco Gambacciani 2017년 3월 17일

카테고리

Help CenterFile Exchange에서 Linear Algebra에 대해 자세히 알아보기

태그

Community Treasure Hunt

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

Start Hunting!

Translated by