Why is Matlab crashing during this program?
Mostrar comentarios más antiguos
For the attached .m files below, when I run sandpiles.m, Matlab is asked to do an intensive computation. It very reliably fails to complete the requested computation by crashing: the entire UI and program act as if I quit the program. No error message appears. What specifically is crashing my code? I am using MATLAB 2017b
1 comentario
Arvind Sathyanarayanan
el 15 de Mzo. de 2019
Editada: Arvind Sathyanarayanan
el 15 de Mzo. de 2019
Try using the debug mode to see where exactly MATLAB gets stuck.
Also, its good practice to avoid clear all as it clears all the functions are removed from the RAM and ends up decreasing your code's performance.
EDIT: I ran your code in debug mode and it looks like you're caught in an infinite loop when you call topple at line 47, the cluprit seems to be this piece of code in topple.m:
if any(sum(A1>crit))
A1 = topple(A1,crit);
else
return
end
You might need to rethink your program's logic.
Respuesta aceptada
Más respuestas (0)
Categorías
Más información sobre Startup and Shutdown en Centro de ayuda y File Exchange.
Productos
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!