How to replace statements in Matlab functions for code generation?
12 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
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,
0 Commenti
Risposte (1)
Steven Lord
il 20 Ott 2023
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?
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!