主要内容

MATLAB Function 和 MATLAB 代码注意事项

R2026b
MATLAB 函数、MATLAB® 代码

对 MATLAB 函数和 MATLAB 代码应用高完整性规范。

建模规范

全部展开

himl_0001:标准化 MATLAB 函数头的使用Use a standardized header to document the purpose and use of MATLAB functions
himl_0003:用户定义的 MATLAB 函数的复/实性Limit the size and complexity of MATLAB function code
himl_0002:MATLAB 函数边界上的强数据定型Explicitly define the complexity and type of input signals, output signals, and parameters at MATLAB function interfaces
himl_0004:MATLAB 代码分析器针对代码生成的建议Use MATLAB Code Analyzer with %#codegen directive and follow code generation recommendations
himl_0006:MATLAB 代码 if/elseif/else 构型Terminate if/elseif/else constructs with an else statement containing meaningful comment
himl_0007:MATLAB 代码 switch/case/otherwise 构型Include at least two case statements and an otherwise statement with a meaningful comment in switch constructs
himl_0008:MATLAB 代码关系运算符数据类型Use the same data type for left and right operands of relational operators
himl_0010:具有逻辑运算符和函数的 MATLAB 代码Use logical data types for logical operators and logical functions
himl_0011:条件表达式的数据类型和大小Use logical scalars for condition expressions
himl_0012:用于代码生成的 MATLAB 函数的使用Restrict MATLAB code to functions supported by code generation
himl_0013:内置 MATLAB 函数复/实性的限制Limit built-in MATLAB function usage that may produce overly complex generated code