Is it possible to do code generation with quadprog() ?

9 ビュー (過去 30 日間)
aparnasri sekar
aparnasri sekar 2018 年 8 月 1 日
編集済み: Clemens Troll 2021 年 7 月 20 日
I know quadprog() is not supported for code generation. But is there a workaround to use the quadprog() fucntion for code generation? I am trying to generate c code from my Simulink model which can be used to integrate with CANoe platform on another pc which may or may not have a MATLAB compiler.

採用された回答

Walter Roberson
Walter Roberson 2018 年 8 月 1 日
編集済み: Walter Roberson 2018 年 8 月 1 日
No, there is no work-around. Very little of the Optimization Toolbox can have code generated.
However, all command line functionality is supported for the Optimization Toolbox with MATLAB Compiler, which would create standalone .exe rather than C or C++ code. That is, you could have your Simulink model use TCP blocks to communicate with some code built using MATLAB Compiler to do the quadprog() .
I would worry that the response time for quadprog() might well be too long for realistic use with a Simulink model.

その他の回答 (1 件)

Mary Fenelon
Mary Fenelon 2020 年 4 月 21 日
Code generation for quadprog is supported in R2020a, following on support for fmincon added in R2019b.
  1 件のコメント
Clemens Troll
Clemens Troll 2021 年 7 月 20 日
編集済み: Clemens Troll 2021 年 7 月 20 日
As documanted in https://de.mathworks.com/help/optim/ug/code-generation-in-quadprog.html code generation for quadprog() is only possible if the 'active-set' solver is applied. Unfortunetaly, my optimization problem is large-scaled and hence is only solvable with the 'interior-point' solver in an accaeptable calculation time.
Is there an outlook that the other solvers are also usable of the code generation in a future release? If not, does anyone know a good alternative of a quadprog solver which one can use in Simulink?

サインインしてコメントする。

Community Treasure Hunt

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

Start Hunting!

Translated by