private folder does not work with live scripts
6 vues (au cours des 30 derniers jours)
Afficher commentaires plus anciens
Live scripts don't seem to support running functions inside a private folder as of R2024B, whereas normal scripts and functions do. An easy workaround is to rename the folder to something else and add it to path. I'm not sure if this is the right place for feedback, but would it be possible to fix this in future releases?
See attached for a minimal reproducible example.
2 commentaires
Réponses (1)
Meet
le 23 Juin 2025
Modifié(e) : Meet
le 23 Juin 2025
Hi Brian,
I was able to reproduce the issue on my end using the example you provided. Since both the "mre.mlx" and "mre2.m" scripts are at the same level in the private folder, I could access the "foo" function within the folder.
Private functions are useful when you want to limit a function's scope. You mark a function as private by placing it in a subfolder named "private." This makes the function accessible only to scripts and functions in the folder directly above the private subfolder.
For more information on "private" functions, you could refer to this MathWorks documentation:
0 commentaires
Voir également
Catégories
En savoir plus sur Introduction to Installation and Licensing dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!