Restore MATLAB functions e.g. openfig.m
2 次查看(过去 30 天)
显示 更早的评论
Dear all,
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.
Best regards,
Louis
4 个评论
Stephen23
2018-9-5
编辑:Stephen23
2018-9-5
Getting burnt once is usually a good way to learn to keep your hand out of the fire.
Not fiddling around with files in the MATLAB installation is the best solution. Instead simply copy them to your working directory, change their name/s, and then make any edits you want... no harm will be done.
Note that Windows (if you use it) might well have "previous versions" saved for that directory, so you could always try restoring from that.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Environment and Settings 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!