How do I include a custom library in the generated code instead of the original library that Stateflow Coder includes?
1 vue (au cours des 30 derniers jours)
Afficher commentaires plus anciens
I would like to include a custom library in the generated code instead of the original library that Stateflow Coder includes.
Réponse acceptée
MathWorks Support Team
le 27 Juin 2009
Follow the steps below to include your custom library instead of the original library:
1. If you want to replace the call to 'math.h' and replace it with your custom library 'mymath.h', open up 'math.h' privided by the compiler and look for an include guard such as that shown below.
The Microsoft provided 'math.h' contains the include guard:
#ifndef _INC_MATH
#define _INC_MATH
......
On UNIX, the include guard is as follows:
#ifndef _MATH_H
#define _MATH_H
.....
2. To customize the code generated by the Stateflow target, go to Tools => RTW Target from the Stateflow chart. Now click on the 'Target Options..' button. This will bring up a window which says "Custom Code included at the top of the generated code" at the top of a pull-down menu.
In this window, insert a #define of this include guard:
#define _INC_MATH
This tells the preprocessor not to include 'math.h' from the compiler.
Refer to the Related Solution for information on how to integrate custom C code into Stateflow.
0 commentaires
Plus de réponses (0)
Voir également
Catégories
En savoir plus sur Model Configuration Set Customization dans Help Center et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!