When I try to use the function 'magic(n)', Matlab says that the execution of the script magic is not supported
3 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
M = magic (300)
Execution of script magic as a function is not supported:
/Users/helloooo/Documents/MATLAB/magic.m
0 commentaires
Réponses (2)
Steven Lord
le 5 Oct 2022
Rename the magic.m file that you've created in the /Users/helloooo/Documents/MATLAB folder. It's preventing MATLAB from accessing the magic function included in MATLAB.
0 commentaires
Benjamin Thompson
le 5 Oct 2022
If your magic.m file does not have "function" at the top, then it is a script and not a function. Scripts cannot be passed arguments in parenthesis. They would normally share the same workspace as the caller.
0 commentaires
Voir également
Catégories
En savoir plus sur Whos 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!