Simulink Reference Previous page   Next Page
Simulink.StructType

Describe a data structure used as the value of a signal or parameter

Description

An object of this class describes a signal or parameter whose values are data structures (i.e., aggregates of data of different types as opposed to arrays of values of the same type). This class is intended to support development and use of custom blocks (e.g., S-Function blocks) that accept or output data structures. The class allows users of such blocks to determine the structure of the signals connected to them.

You can use either the Model Explorer or the MATLAB command line to create an instance of this class. To define the elements of a structure, create an array of instances of Simulink.StructElement at the MATLAB command line and assign the array as the value of the structure's Elements property. For example, the following commands define a structure that contains a floating point and an integer element.

You can use a structure type object to specify the data type of Inport and Signal Specification blocks. To do this, enter the name of the variable that references the structure type object as the data type in the block's parameter dialog box.

The Simulink S-function API lets you create S-functions capable of generating and manipulating signal structures (see the simstruct.h header file for more information). You can connect signal structures created by S-function blocks to any standard Simulink block that accepts any data type. This includes virtual blocks and the Switch block configured to require the same data type on all its data inputs.

Property Dialog Box

Struct elements
Table that displays the properties of the structure's elements. You cannot edit this table. To add or delete this structure's elements or change the properties of elements, you must use MATLAB commands, e.g.,
Header file
Name of a C header file that declares this structure. This field is intended for use by Real-Time Workshop. Simulink ignores it.
Description
Description of this structure. This field is intended for you to use to document this structure. Simulink itself does not use this field.

Properties

Name
Access
Description
Elements
RW
An array of Simulink.StructElement objects that define the names, data types, dimensions, and numeric types of the structure's elements. The elements must have unique names. (Struct elements)
Description
RW
String that describes this structure. This property is intended for user use. Simulink itself does not use it. (Description)
HeaderFile
RW
String that specifies the name of a C header file that declares this structure. (Header file)

See Also
Simulink.StructElement


Previous page  Simulink.StructElement Simulink.SubsysDataLogs Next page

© 1994-2005 The MathWorks, Inc.