Why is Matlab crashing during this program?
Afficher commentaires plus anciens
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 commentaire
Arvind Sathyanarayanan
le 15 Mar 2019
Modifié(e) : Arvind Sathyanarayanan
le 15 Mar 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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Startup and Shutdown dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!