How can I determine if a script is being run by the codegen -test input parameter?
Mostra commenti meno recenti
I would like to avoid running certain lines of code when runing a script that calls a generated mex file (codegen -test or coder.runTest).
I have a script that builds an entry point function "functionA"
codegen -config cfg functionA -args ARGS -test testScript
And I would like to avoid running certain lines of code within testScript only when running the test with codegen (i.e. in the codegen command or with coder.runTest). Is this possible, and if so how.
My first instinct was ~coder.target('MATLAB'), isdeployed, ismcc, however none of these return a true flag when running in test mode.
Risposta accettata
Più risposte (1)
Noam Greenboim
il 7 Mag 2024
you can use the
coder.target
function to determine whether it's a mex or matlab.
Categorie
Scopri di più su Automated Fixed-Point Conversion in MATLAB in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!