Increase the Java heap size: https://www.mathworks.com/help/matlab/matlab_external/java-heap-memory-preferences.html