我想将所有常用函数放入“某种”库文件中,并在其他 .m 文件中引用它。我怎样才能做到这一点?谢谢。
最佳答案
您可能想要研究的一件事是 packages作为组织功能和类(class)的一种方式。来自文档:
Packages are special folders that can contain class folders, function and class definition files, and other packages. Packages define a scope (sometimes called a namespace) for the contents of the package folder. This means function and class names need to be unique only within the package. Using a package provides a means to organize classes and functions and to select names for these components that other packages can reuse.
关于matlab - Matlab中如何引用另一个文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5495131/