Attempt to execute SCRIPT ' ' as a function error
13 views (last 30 days)
Show older comments
Hi,
I am running custom code that has worked fine for a couple of years and I'm suddenly running into the following error:
Attempt to execute SCRIPT graphics/private/adjustGridLineStyles as a function
The function above is a Matlab function, and I have nothing that shares its name.
Prior to this, I had an identical error with two other Matlab functions including the following:
Attempt to execute SCRIPT internal.stats.strCollapse as a function
So I don't think it's my code. I am on a new computer but I have it set up like the old one and I've reset paths to default. Any ideas would be helpful.
Thank you.
3 Comments
Matt J
on 14 Feb 2024
I would do a clean reinstall (i.e., completely deleting all pre-existing Maltab installation folders).
Answers (1)
Walter Roberson
on 14 Feb 2024
This problem is caused by a corruption of the MATLAB installation, one that causes it to lose track of the internal implementation of functions. The search for the function instead finds the .m file that exists only for documentation purposes. Because the documentation .m has only comments, it is technically a script file.
There is a possibility that the system might fix itself if you do
restoredefaultpath; rehash toolboxcache
but it is common that when this sort of corruption occurs that you need to reinstall MATLAB.
0 Comments
See Also
Categories
Find more on Introduction to Installation and Licensing in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!