How do I write a standard function header for Model Advisor?

11 ビュー (過去 30 日間)
MathWorks Support Team
MathWorks Support Team 2023 年 8 月 21 日
回答済み: MathWorks Support Team 2023 年 8 月 29 日
I am getting the following warning when running Model Advisor in R2021b to check my function header:
Warning
The following MATLAB functions use non-standard function headers
However, I believe I am following the example shown for mathworks.hism.hisl_0001 in the link below
https://www.mathworks.com/help/releases/R2021b/slcheck/ref/hism-checks_hism_checks.html#mw_sep_himl_0001 
What should a standard function header for Model Advisor look like?

採用された回答

MathWorks Support Team
MathWorks Support Team 2023 年 8 月 21 日
The check requires the function name to be present in the function header per the following link:
https://www.mathworks.com/help/releases/R2021b/simulink/mdl_gd/hi/matlab-functions.html#btolvhf-1
Please note, referencing the documentation above, the function name can not be in-line with "FUNCTION NAME", though "FUNCTION NAME" doesn't need to be present. For example, if your function name is 'aFunction', the following two will pass the function name requirement:
function [out] = aFunction(in1, in2)
% aFunction
......
function [out] = aFunction(in1, in2)
% FUNCTION NAME:
% aFunction
......
though the following will not
function [out] = aFunction(in1, in2)
% FUNCTION NAME: aFunction
......
It is also important to note that the function header needs to be strictly before the function declaration, i.e.
% FUNCTION NAME:
% aFunction
......
function [out] = aFunction(in1, in2)
is not accepted.

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeCheck Model Compliance についてさらに検索

製品


リリース

R2022b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by