Hi!
I'm currently working on a Simulink project where I need to solve a Mixed Integer Linear Programming (MILP) problem. I tried to implement the code in a MATLAB function block, but I get the error: "Function 'intlinprog' not supported for code generation."
I was wondering if there is a way to implement the intlinprog function in Simulink or if there's a workaround to call an M-file during the simulation. My goal is to solve the optimization problem in every time step of the simulation.
Thanks for your help!

 Respuesta aceptada

Harald
Harald el 3 de Jul. de 2023
Hi Dan,
the problem is that intlinprog is not supported for code generation and Simulink generates C code from the code contained in MATLAB Function blocks.
If you just want to run simulations within Simulink, you can define intlinprog as extrinsic:
coder.extrinsic('intlinprog')
The downside: You will then not be able to generate code from the Simulink model.
Best wishes,
Harald

Más respuestas (0)

Categorías

Más información sobre Quadratic Programming and Cone Programming en Centro de ayuda y File Exchange.

Productos

Versión

R2023a

Preguntada:

Dan
el 30 de Jun. de 2023

Comentada:

Dan
el 4 de Jul. de 2023

Community Treasure Hunt

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

Start Hunting!

Translated by