I was playing around with openfig.m the other day. I kept a back-up copy of the file just in case something went wrong. However, I have managed to mess something up so that even with the back-up file reinstated, .fig files will no longer open and I get the error "Undefined variable "matlab" or class "matlab.graphics.internal.convertStringToCharArgs".
A general question: If the user somehow manages to "break" an M-file in the MATLAB root (like openfig.m), is there any way to restore the original M-files without reinstalling MATLAB? All of my project code is under version control, but this is not the case for the files under the root folder.