Matlab 2014b code generation of reference model

I have problem on code generation by using Matlab 2014b
I want to change function names in source and header file which are generated by matlab 2014b regardless of the name of simulink reference model
For example,
I have reference model "mymodel.slx"
When I generate source code, then I am able to get "mymodel.c" and "mymodel.h"
In "mymodel.c" I have executable function "void mymodel(void)"
However, I want to change function name "void mymodel(void)" to "void absd(void)"
Is it possible?

回答(1 个)

Hi Kangneoung,
Yes you can customize the function names in the source file and header file by either using the Configuration settings or the embedded coder dictionary
Using Configuration settings: You can go to Interface -> Configure model functions -> change the function specification there.
If you have a later version of MATLAB then using the Embedded coder dictionary you can follow the below steps:
1) In the Embedded coder dictionary, you can go to "Function customization template", customize the way you want to name the function.
2) In the code mappings, under the Entry-Point functions, you can assign this template.
Once you generate code, you should be able to see void customizedname(void) instead of void modelName(void)

类别

帮助中心File Exchange 中查找有关 Deployment, Integration, and Supported Hardware 的更多信息

产品

版本

R2014b

Community Treasure Hunt

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

Start Hunting!

Translated by