mathworks / mathworks/MATLAB-Coding-Guidelines
Naming rules for struct/class/bus
还没有人认领这个 Issue。
- 主要语言
- 没有语言数据
- 星标
- 139
- 派生
- 11
- PR 合并指标
- 30 天内没有已合并 PR
描述
I noticed there isn’t yet an explicit guideline for struct names and, in particular, for struct field names. The only related reference I found, “Defining structs”, includes an example where the struct members use UpperCamelCase. Should these be UpperCamelCase? And if so, should the same convention apply to Simulink.Bus elements?
I’m asking because this can create a mismatch with some Model Advisor naming guidelines. For example, suppose I have a Simulink Inport of type Bus, with elements Signal1 and Signal2, which has been created from a MATLAB struct or class. If I use a Bus Selector to extract Signal1 and feed it into a MATLAB Function block, where the corresponding function parameter is named signal1 (lowerCamelCase, following MATLAB function parameter conventions), Model Advisor will trigger a violation because the bus element name (UpperCamelCase) doesn’t match the block input name (lowerCamelCase).
Is there any recommendations on how to harmonize these conventions?
贡献指南
这个仓库没有索引到贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先阅读现有的“Defining structs”指南,以及 issue 中引用的 Model Advisor 命名指南。比较 MATLAB 中 struct 和 class 字段与 Simulink.Bus 元素的命名约定,并记录一项一致的建议,以解决所述 bus 与 MATLAB Function 之间的命名不匹配问题。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- matlab
- 领域
- documentation
- Issue 类型
- 文档
- 难度
- 5/5
- 预计耗时
- 一周以上
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100