Skipping execution paths for autocoding
1 Ansicht (letzte 30 Tage)
Ältere Kommentare anzeigen
Samuel Pawlyk
am 10 Aug. 2022
Beantwortet: Konstantinos Athanasiou
am 11 Aug. 2022
I have a code base where there are a number of possible techniques to solve a problem each with pros and cons. It is set up so I can choose between these functions at runtime with a flag. However some of the solution methods can not be autocoded. I would like a way to tell the autocoder to skip trying to compile specific execution paths.
For example
SolverMethod = ?
if solverMethod ==1:
solveWithMethodA()
elseif solverMethod ==2:
solveWithMethodB() //Can not autocode
elseif solverMethod ==3:
solveWithMethodC()
else
solveWithMethodA()
This code should still be able to autocode and just not offer solverMethod B. is there a way to do this?
0 Kommentare
Akzeptierte Antwort
Konstantinos Athanasiou
am 11 Aug. 2022
Following your example above you can do
elseif solverMethod == 2 && coder.target('MATLAB')
to indicate that solveWithMethodB is targeting MATLAB (not code generation).
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Embedded Coder finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!