필터 지우기
필터 지우기

Skipping execution paths for autocoding

조회 수: 1 (최근 30일)
Samuel Pawlyk
Samuel Pawlyk 2022년 8월 10일
답변: Konstantinos Athanasiou 2022년 8월 11일
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?

채택된 답변

Konstantinos Athanasiou
Konstantinos Athanasiou 2022년 8월 11일
Use coder.target to determine the target of the solver methods
Following your example above you can do
elseif solverMethod == 2 && coder.target('MATLAB')
to indicate that solveWithMethodB is targeting MATLAB (not code generation).

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 Embedded Coder에 대해 자세히 알아보기

태그

제품


릴리스

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by