I scripted a time-frequency decomposition on sources with Morlet wavelets (EEG data, 64 channels), averaging on four frequency bands: alpha (8-12 Hz), beta1 (13-19 Hz), beta2 (20-25 Hz) and beta3 (26-30 Hz). It worked just fine, until it stopped working for apparently no reason. If I average on 3 frequency bands instead of 4, it works. I have a 32GB RAM, so that could be the reason? But I really don't understand why it worked perfectly before. The script hasn't changed, it just stopped working after a bunch of subjects. It doesn't work even when cleaning MATLAB workspace, or by rebooting the computer. I also tried running the same script on a subject on which it already worked and it gives me the same error. I don't see anything using up RAM space differently from before.
Any ideas on what the reason may be?