How to replace statements in Matlab functions for code generation?
Mostrar comentarios más antiguos
I would like to have optional code in a functions which is used for autocoding. This should be similar to preprocessor/compiler directives in C/C++. For example:
%#if CODEGEN
a = someFunctionNotCodeGenerationCapable(b);
%#else
a = simplifiedFunctionCodeGenerationCapable(b);
%#endif
This would allow to have a simulation in Matlab with more sophisticated functions e.g. GUI which may prevent code generation.
When code is generated it should be replace by another function for which code can be generated,
Respuestas (1)
Steven Lord
el 20 de Oct. de 2023
0 votos
Are you hoping to do code replacement? Or are you thinking of something smaller like checking coder.target to see if you're in MATLAB or generating code for a specific target?
Categorías
Más información sobre MATLAB Coder en Centro de ayuda y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!