快速将单个文件类转换为文件夹类

发布于 2024-12-29 02:02:03 字数 82 浏览 4 评论 0原文

我有几个类,每个类都在一个文件中。有没有一种快速方法将它们转换为 @-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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

怂人 2025-01-05 02:02:03

您不需要从 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 the private subdirectory.

Look at the timeseries class as an example of a class defined using a classdef file and an @-folder. Should be in $matlabroot\toolbox\matlab\timeseries\@timeseries.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文