- Is your system really out of memory? Use your system's tool that checks memory to see if this it true. On Windows it's Task Manager. On Mac and Linux there are similar programs.
- If you are out of memory, see if your system can accept more memory. Buy more memory and install it. If you are on a 32-bit system and you have 4 GB already, upgrade to a 64-bit OS and put more memory in the machine.
Keep in mind, though, that every operating system MATLAB runs on has a 64-bit variant, and has had a 64-bit variant for some time, so these techniques may help for some time, but it's entirely likely that they are only buying you a little time until you hit the memory problems again.