I found the error message on another thread, but now reading this, I think the opengl hardware command should have fixed it, but for some reason it didn't.
Warning: MATLAB previously crashed due to a low-level graphics error. To prevent another crash in this session, MATLAB is using software OpenGL instead of using your graphics hardware. To save this setting for future sessions, use the opengl('save', 'software') command. For more information, see Resolving Low-Level Graphics Issues.