Borrar filtros
Borrar filtros

Timer stops randomly in the middle of its callback

6 visualizaciones (últimos 30 días)
Kelly Babitz
Kelly Babitz el 6 de Ag. de 2017
Comentada: per isakson el 29 de Sept. de 2017
I have a GUI with a timer. I start the timer, and it randomly will stop at some point while it is running and give the error: Index exceeds matrix dimensions. Error while evaluating TimerFcn for timer 'timer-1'
I do not think there is actually a matrix index it is accessing that is grater than the length of the index for a few reasons:
-All the matrices it accesses are much longer than the index it should be accessing at the time it stops
-The timer stops at different times every time I run it, which makes me feel like there is not a particular index limit that is actually causing problems
-I have commented out all the actual code the timer runs (so the timer literally just runs with no callbacks) and it still will stop at random times with the same error message.
I have no idea how to fix this. Is this just a buggy feature in matlab, or is there something else wrong with what I am doing.
I would also appreciate some help in figuring out how to better debug my code, as the error message does nothing to help me (it gives no line where the error occurs)
  3 comentarios
Walter Roberson
Walter Roberson el 6 de Ag. de 2017
Posting code would help
per isakson
per isakson el 29 de Sept. de 2017
The problem is that Matlab doesn't provide a "complete error message". (Caveat: as of R2016a at least)

Iniciar sesión para comentar.

Respuestas (1)

Titus Edelhofer
Titus Edelhofer el 6 de Ag. de 2017
what did you write into your timer function, directly some code or the call of a MATLAB (.m) file? If you put your code into a .m file you should get proper error message with line numbers ...


Más información sobre Creating and Concatenating Matrices en Help Center y File Exchange.

Community Treasure Hunt

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

Start Hunting!

Translated by