快速将单个文件类转换为文件夹类
我有几个类,每个类都在一个文件中。有没有一种快速方法将它们转换为 @-folder 类?将所有单个函数一次一次转移到单独的函数文件中是一件痛苦的事情。
I have several classes in one single file each. Is there a quick way to convert them to @-folder classes? It's a pain to transfer all single functions to separate function files once by once.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您不需要从
classdef
文件中移动现有方法:您只需将其移动到 @ 文件夹并将新方法添加为单独的 M 文件即可。请注意,定义为 M 文件的方法始终是公共的,除非它们位于private
子目录中。查看
timeseries
类作为使用classdef
文件和 @-folder 定义的类的示例。应位于 $matlabroot\toolbox\matlab\timeseries\@timeseries 中。You don't need to move the existing methods from the
classdef
file: you can just move it to the @-folder and add new methods as separate M-files. Note that methods defined as M-files are always public, unless they're in theprivate
subdirectory.Look at the
timeseries
class as an example of a class defined using aclassdef
file and an @-folder. Should be in$matlabroot\toolbox\matlab\timeseries\@timeseries
.