Simulink Code Generation with CBC or GLPK

92 views
Skip to first unread message

Steffen Mann

unread,
Nov 27, 2018, 1:42:02 PM11/27/18
to YALMIP
Dear All,

I have implemented a MPC with a MILP and want to use an open source solver like CBC or GLPK.
I know that both solvers, in the opti-toolbox, have a .mex file which I can call in the Matlab console.
Additionally I can export my Yalmip model and call the mex function of CBC or GLPK to solve my optimization problem. 
Now I want to load my exported Yalmip model into Simulink and call the solver as an S-function in Simulink. 

Is there a simple way to convert the mex-file of the solver to an S-function?
Does anyone of you have made experiences with this approach?  
In the end, I want to generate code from the simulink model, to use it on an embedded system. 

Thank you for any help!

Johan Löfberg

unread,
Nov 27, 2018, 1:49:45 PM11/27/18
to YALMIP
This is all I know

Well, I also now that you cannot compile the Simulink code if there is YALMIP code in it.


Reply all
Reply to author
Forward
0 new messages