This issue could be due to RAM limitations. Try the following suggestions:
1. Go to MATLAB > Preferences > Workspace and ensure the Maximum array size limit is set to 100%. Then execute 'memory' command in the Command Window and send the output. Ensure that the Maximum possible array size is larger than the memory required by the data used in neural network.
2. Also, check that the Java Heap Memory is not set to a very large value because that might restrict the amount of memory available to perform computations.