Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Simulink with Object Oriented code
Replies: 2   Last Post: Sep 8, 2013 1:07 PM

Advanced Search

Back to Topic List Back to Topic List Jump to Tree View Jump to Tree View   Messages: [ Previous | Next ]
Phil Goddard

Posts: 352
Registered: 1/27/12
Re: Simulink with Object Oriented code
Posted: Sep 8, 2013 11:21 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Although this can be done, be prepared for considerable frustration as Simulink is not designed to work with MATLAB objects.

You will not be able to pass MATLAB objects down a Simulink signal.
(This can be done with custom C data types, using c-mex S-functions, but not with m-code S-functions.)
With a little work you can pass the handle of an object down a signal (as it can be mapped to a double, and your m-code S-Functions will need to know that the double represents a handle and know what to do with it) , but you will need to store the object somewhere (global memory, workspace, userdata) which you indicate that you (quite rightly) want to avoid.

Phil.



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.