The Math Forum

Search All of the Math Forum:

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

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

Notice: We are no longer accepting new posts, but the forums will continue to be readable.

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: 358
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.


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

[Privacy Policy] [Terms of Use]

© The Math Forum at NCTM 1994-2018. All Rights Reserved.