matlab - 如何自动更改 M 文件中已在两个 Matlab 版本之间删除/更改的函数?
问题描述
我正在寻求流程自动化方面的帮助。简而言之,我有一份在 2011a 和 2018b 中编写的 Matlab 代码/应用程序列表(总共 30 个)。这意味着超过 100 000 个具有 .m 或 .p 扩展名的文件,其中许多包含已更改/删除的功能。我想自动化迁移过程,如下所述:
1. Make a list of all matlab functions that have changed/removed between the 2011a release and the 2018b release (Has been done already)
2. Get all the m-files and p-files that exist in a specific directory (store them in a variable), (Has been done already)
3. Automatically open each file (defined as above) then:
a. Scan each line of code and
b. If any of the function listed above appear in the code, then:
I. If it’s simply changed name (i.e same syntax and same number of arguments) then:
• automatically replace it everywhere in the code
• Save and close the file
II. If the syntax of the function has changed for example the function takes one more or one less argument, then do the following:
• Show where the function appears in the code
• Let the user manually change it once (dialogue box)
• Then automatically apply the new syntax everywhere else in the code to replace the old syntax
• Save the file and close it
III. Otherwise: save and close the file
解决方案
推荐阅读
- javascript - 酶 | 有条件地检查道具
- r - R中针对大数据的轮廓计算
- python - Apache Spark StringIndexer 应用不存在的标签(看不见的标签异常)
- rest - 尝试使用 POSTMAN 在 REST API 上发布 Hyperledger 交易时出现验证错误(错误代码 422)
- python - 在 matplotlib 中增加图形大小会导致所有其他格式变小
- java - JavaFX listview init() 方法
- android - Android 活动生命周期 - onStop() 之后和 onDestory() 被调用时会发生什么
- azure-devops - 将使用 CICD 的项目迁移到衍生流程
- javascript - 从对象数组中删除属性
- python - 为行组添加不同的缺失日期