private folder does not work with live scripts
6 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
回答 (1 件)
Meet
2025 年 6 月 23 日
編集済み: Meet
2025 年 6 月 23 日
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 件のコメント
参考
カテゴリ
Help Center および File Exchange で Introduction to Installation and Licensing についてさらに検索
製品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!