필터 지우기
필터 지우기

Using intlinprog in Simulink

조회 수: 5 (최근 30일)
Dan
Dan 2023년 6월 30일
댓글: Dan 2023년 7월 4일
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!

채택된 답변

Harald
Harald 2023년 7월 3일
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
  댓글 수: 1
Dan
Dan 2023년 7월 4일
That worked.
Thank you Harald!

댓글을 달려면 로그인하십시오.

추가 답변 (0개)

제품


릴리스

R2023a

Community Treasure Hunt

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

Start Hunting!

Translated by