Error when using hold on
3 次查看(过去 30 天)
显示 更早的评论
Due to some things, I previously used and followed this command (and knowing later that I should not have done that):
>> movefile('/Applications/MATLAB_R2017b.app/toolbox/matlab/graphics/hold.m', '/Applications/MATLAB_R2017b.app/toolbox/matlab/graphics/was_named_hold.m')
After this, I received "Previously accessible file "/Applications/MATLAB_R2017b.app/toolbox/matlab/graphics/hold.m" is now inaccessible."
Following a suggestion from the community, then I typed the command: "rehash toolboxcache". First try, it did not work (even after restarting MATLAB). I tried typing "which hold" and got this:
>> which hold
/Applications/MATLAB_R2017b.app/toolbox/matlab/graphics/hold.m
When I run my code to plot something, it gave me the error like this:
Error: File: hold.m Line: 1 Column: 25
The input character is not valid in MATLAB statements or expressions.
I then opened the file hold.m and I attached it along with this question. I appreciate if someone could help me guiding to solve this.
Thank you.
Dini
PS: I used MATLAB 2017b and also attached my script that uses hold on function.
2 个评论
Stephen23
2023-6-9
"knowing later that I should not have done that"
Just to make it clear for anyone reading this thread: do NOT move, modify, edit, etc. any of MATLAB's toolbox files.
Also: do not save your own Mfiles in the installation folders of any application!
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Introduction to Installation and Licensing 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!