Error when using hold on

3 views (last 30 days)
Dini Nurfiani
Dini Nurfiani on 9 Jun 2023
Commented: Dini Nurfiani on 10 Jun 2023
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 Comments
Stephen23
Stephen23 on 9 Jun 2023
"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!
Dini Nurfiani
Dini Nurfiani on 10 Jun 2023
Thank you. Noted.

Sign in to comment.

Answers (0)

Categories

Find more on Introduction to Installation and Licensing in Help Center and File Exchange

Tags

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!