Attempt to execute SCRIPT ' ' as a function error
13 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
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 commentaires
Matt J
le 14 Fév 2024
I would do a clean reinstall (i.e., completely deleting all pre-existing Maltab installation folders).
Réponses (1)
Walter Roberson
le 14 Fév 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 commentaires
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!