From: Patrick on
Hi!
Is it possible to use structured data in Simulink? The Simulink documentation is a little vague on the issue. For example, I would like to create a c-like data type to contain a number of bytes, doubles, etc. And I would like to typecast a data store memory to hold that structure. There doesn't seem to be any documentation of being able to do that. Nor of how to define that structure and define a signal of that type. thanks!
From: Jesse Hopkins on
"Patrick " <pomalle(a)sandia.gov> wrote in message <i3se9c$aut$1(a)fred.mathworks.com>...
> Hi!
> Is it possible to use structured data in Simulink? The Simulink documentation is a little vague on the issue. For example, I would like to create a c-like data type to contain a number of bytes, doubles, etc. And I would like to typecast a data store memory to hold that structure. There doesn't seem to be any documentation of being able to do that. Nor of how to define that structure and define a signal of that type. thanks!

You'll need to use Buses. If you are going to be autocoding your model and want to see c-structures, make sure to use "non-virtual" buses. See the "bus-creator" block in the the simulink library. You can define the bus-types via the bus-editor. Type "buseditor" at the matlab prompt to bring up the bus editor. (or select from the simulink tools menu). Here you can define buses, their signal names, dimensions, datatypes, etc. Then you use a bus-creator to instantiate the bus. (check the "UseBusObject" to enforce using the bus that you have defined).

PS. Once you define your buses, be sure to save them to a .mat file or .m file before closing matlab or executing "clear all" or the definitions will be lost!
 | 
Pages: 1
Prev: ylim in errorbar
Next: Axis spacing in matlab