Before fixing memory issues, without getting an "Memory Error" message that would suggest this is the issue, perhaps look into rewriting your code to avoid scripts, clear, global and eval. These are much larger issues than your crashing error - which should resolve itself when you rework your code using best practices.
global: it's hard to figure out what operation is modifying your variables, and in what order. Use regular variables and pass them into your functions as inputs.
script: does not compartmentalize your tasks, which means you'll end up using clear to clear up memory, which is very slow and makes your code much more difficult to maintain as you must search and clear variables you don't need. Also, functions will generate an error if something goes wrong, so you can debug just that function.
clear: takes up a lot of time and it's hard to keep track of temporary variables. With functions, temporary variables are automatically cleared when function completes, saving only the outputs.
eval: worst function to use, as matlab cannot pre-check your code for potential error, as in anything can go and crash your computer. You need to use the appropriate function name instead
Read these blogs for starters, and begin reworking your code. Also, use debugging tools. For crashes, consider running your code line-by-line until it crashes (hopefully, your reworked code won't crash but will return an error message instead).