ID: Title | himl_0001: Usage of standardized MATLAB® function headers |
---|---|
Description | When using MATLAB functions, use a standardized header to provide information about the purpose and use of the function. |
Rationale | A standardized header improves the readability and documentation of MATLAB functions. The header should provide a function description and usage information. |
Model Advisor Checks | Check usage of standardized MATLAB function headers (Simulink Check) |
References | DO-331, Section MB.6.3.4.e – Source code is traceable to low-level requirements |
See Also |
|
Last Changed | R2018b |
Examples | A typical standardized function header includes:
Example: % FUNCTION NAME: % avg % % DESCRIPTION: % Compute the average of three inputs % % INPUT: % in1 - (double) Input one % in2 - (double) Input two % in3 - (double) Input three % % OUTPUT: % out - (double) Calculated average of the three inputs % % ASSUMPTIONS AND LIMITATIONS: % None % % REVISION HISTORY: % 05/02/2018 - mmyers % * Initial implementation % |
ID: Title | himl_0002: Strong data typing at MATLAB function boundaries |
---|---|
Description | To support strong data typing at the interfaces of MATLAB functions, explicitly define the interface for input signals, output signals, and parameters, by setting:
|
Rationale | Defined interfaces:
|
Model Advisor Checks | Check for MATLAB Function interfaces with inherited properties (Simulink Check) |
References |
|
See Also |
|
Last Changed | R2016a |
Examples | Recommended: In the Ports and Data Manager, specify the complexity and type of input
Not Recommended: In the Ports and Data Manager, do not specify the complexity and type
of input
Note To access the Ports and Data Manager, from the toolbar of the MATLAB Function Block Editor, select Edit Data. |
ID: Title | himl_0003: Limitation of MATLAB function complexity | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Description | When using MATLAB functions, limit the size and complexity of MATLAB code. The size and complexity of MATLAB functions is characterized by:
| ||||||||||||
Note | Size and complexity limits can vary across projects. Typical limits might be as described in this table:
| ||||||||||||
Rationale |
| ||||||||||||
Model Advisor Checks | Check MATLAB Function metrics (Simulink Check) | ||||||||||||
References |
| ||||||||||||
See Also |
| ||||||||||||
Last Changed | R2016a |