Borrar filtros
Borrar filtros

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

7 visualizaciones (últimos 30 días)
mim
mim el 5 de Jul. de 2013
Comentada: Jan el 21 de Mzo. de 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?

Respuesta aceptada

Jan
Jan el 5 de Jul. de 2013
Are you looking for TRY/CATCH?
  2 comentarios
mim
mim el 5 de Jul. de 2013
what's that? and how it can help me?
Jan
Jan el 21 de Mzo. de 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.

Iniciar sesión para comentar.

Más respuestas (1)

Marco Gambacciani
Marco Gambacciani el 17 de Mzo. de 2017

Categorías

Más información sobre Linear Algebra en Help Center y File Exchange.

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by