From: Tanuj on
Hi all,

I have a SIMULINK model that contains in it a couple of Level 2 M-File S-Functions. This model needs to be run interactively with a third party-solver. For this, I need to convert this model to C code and generate dll's which I can then link with the third party solver.

The RTW tool provides one way of doing this for me. However, my S-Functions use structures as dialog parameters and I believe structures are not supported by the RTW tool. Is there a way around this?

Also, apparently the Embedded Matlab Function is another way of doing this, since it supports structures. Is it a good idea to convert the S-Function to the Embedded Matlab Fcn, and will this even work?

Is there any other option that I am missing out here? I need to be able to access the struct parameters inside the S-Function and then generate C code for this.

Any help on this is appreciated.

Thanks.
Tanuj
From: Murugaiyan on
"Tanuj " <tanujkush(a)gmail.com> wrote in message <i1mep2$420$1(a)fred.mathworks.com>...
> Hi all,
>
> I have a SIMULINK model that contains in it a couple of Level 2 M-File S-Functions. This model needs to be run interactively with a third party-solver. For this, I need to convert this model to C code and generate dll's which I can then link with the third party solver.
>
> The RTW tool provides one way of doing this for me. However, my S-Functions use structures as dialog parameters and I believe structures are not supported by the RTW tool. Is there a way around this?
>
> Also, apparently the Embedded Matlab Function is another way of doing this, since it supports structures. Is it a good idea to convert the S-Function to the Embedded Matlab Fcn, and will this even work?
>
> Is there any other option that I am missing out here? I need to be able to access the struct parameters inside the S-Function and then generate C code for this.
>
> Any help on this is appreciated.
>
> Thanks.
> Tanuj

hi,
check this it will help you
http://blogs.mathworks.com/seth/2010/07/18/including-matlab-code-in-a-simulation/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed%3A+SethOnSimulink+%28Seth+on+Simulink%29

tamil
From: Tanuj on
Hi Murugaiyan,

Thanks for taking the time to post a reply. Your link was useful to me, but then again, I have found a workaround for my problem.

Thanks anyways,
Tanuj