Conventional / "best practices" location for personal functions

4 次查看(过去 30 天)
Is there a conventional / standard / "best practices" location for parking self-developed functions, such that they are globally available from the command prompt (i.e. independent of current working directory)? I initially thought about $MATLABROOT/toolbox/local, but that contains exclusively TMW-provided scripts and text files. Moreover, as explained by John D'Errico in this old thread, there are potential issues with path caching at startup for anything placed inside $MATLABROOT.
(To be clear, I'm interested in where, rather than how. Either path or pathtool can be used to do the latter.)
  5 个评论
AMM
AMM 2020-6-3
dbp, Stephen—thanks both.
I accepted the one from Image Analyst because that was the only one I could (everything else here is posted as a comment), but the consensus among you is pretty clear. Cheers. -AMM

请先登录,再进行评论。

采纳的回答

Image Analyst
Image Analyst 2020-5-22
I do just like dpb says. The Mathworks told me to have a work folder, and all my various 200+ projects have subfolders under work. In addition, I have one folder there called Utilities that has a bunch of useful functions that I use all the time in other programs. I set a path to it in my startup.m file.

更多回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Adding custom doc 的更多信息

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by