Has anyone tried using s-functions instead of Matlab interpreter functions to perform YALMIP based simulations in Simulink ?

44 views
Skip to first unread message

glanke92

unread,
Mar 5, 2020, 7:57:53 PM3/5/20
to YALMIP
Hi All,

I followed Dr. Johan's article : https://yalmip.github.io/example/simulink/ and tried to implement using the MATLAB interpreter function.

But it seems that for the problem that I have, it is very tedious an hard to go ahead with the MATLAB interpreter function due to its limited capabilities when handling the inputs and outputs.

So I thought of using s-functions to do the same thing.

But the problem that I have is whether that kind of thing can be done using s-functions in MATLAB (problems with code generation) ?

I would really appreciate if anyone could give his/her own opinion and experience regarding this ?

Thank you.


Johan Löfberg

unread,
Mar 6, 2020, 2:01:53 AM3/6/20
to YALMIP
I think that is impossible, as you would have to have suitable S-function layers for the solver you intend to use (and I believe it is impossible to use these constructs for object oriented code like YALMIP, at least it used to be)

Adding to that, using MATLAB interpreted function is the easiest possible way to work with simulink. Going to S-functions will not make easier, only harder.

What is wrong with simply saving the data you need, and then doing a load in the function, or using global variables? 
Reply all
Reply to author
Forward
0 new messages