Filter löschen
Filter löschen

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

7 Ansichten (letzte 30 Tage)
mim
mim am 5 Jul. 2013
Kommentiert: Jan am 21 Mär. 2017
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?

Akzeptierte Antwort

Jan
Jan am 5 Jul. 2013
Are you looking for TRY/CATCH?
  2 Kommentare
mim
mim am 5 Jul. 2013
what's that? and how it can help me?
Jan
Jan am 21 Mär. 2017
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.

Melden Sie sich an, um zu kommentieren.

Weitere Antworten (1)

Marco Gambacciani
Marco Gambacciani am 17 Mär. 2017

Kategorien

Mehr zu Linear Algebra finden Sie in Help Center und File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!

Translated by