Why is Matlab crashing during this program?
Show older comments
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 Comment
Arvind Sathyanarayanan
on 15 Mar 2019
Edited: Arvind Sathyanarayanan
on 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.
Accepted Answer
More Answers (0)
Categories
Find more on Startup and Shutdown in Help Center and File Exchange
Products
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!