Type Editor
Create, modify, and manage types, such as bus objects
Description
The Type Editor lets you interactively create, modify, and manage types.
The supported types are:
Simulink.Bus
objects withSimulink.BusElement
objectsSimulink.ConnectionBus
objects withSimulink.ConnectionElement
objectsSimulink.ValueType
objectsSimulink.AliasType
objectsSimulink.NumericType
objectsSimulink.data.dictionary.EnumTypeDefinition
objects in data dictionaries
The Sources pane provides available sources, which are the MATLAB® base workspace and open data dictionaries. The objects that you create are stored in the selected source. In the toolstrip, you can create or open a data dictionary. You can also import objects defined by a MAT file, function, or script into the base workspace.
The Contents pane provides an interactive table with information about the objects, such as hierarchy and properties. You can select which columns appear in the table by using the Columns list in the toolstrip. Use the table to:
Filter objects — Enter a universal filter or a column-specific filter.
Edit objects — Double-click a value in the table and enter a new value. When you enter a value that is not supported, a diagnostic message appears in this pane.
Batch edit objects — Select objects of the same type that you want to edit. Double-click a value of one of the selected objects and enter a new value. The new value applies to all selected objects.
Navigate among types — Right-click an object that references another object and select Go to. Alternatively, click an object to highlight its referenced object. Use this navigation to bring you to the editable instance of a bus object and its elements.
Reorder bus element objects — Drag the bus element objects to a new position or use the Move Up and Move Down buttons in the toolstrip.
Cut, copy, and paste objects — Use keyboard shortcuts or the corresponding buttons in the toolstrip.
Delete objects — Press the Delete key or click the Delete button in the toolstrip. When you delete a bus object, you also delete the bus element objects it contains. Update any blocks that specify the deleted object. To find where a bus object is used in a model, see Finding Blocks That Use a Specific Variable.
Note
Changes that create, reorder, or delete objects take effect immediately in the base workspace. The Contents pane of the Type Editor does not support undo or redo actions.
The Property Inspector pane lets you focus on one object at a time and edit the object properties. When you enter a value that is not supported, a diagnostic message appears in this pane. To undo or redo a change, right-click the corresponding box. Then, select Undo or Redo.
The Type Editor can export object definitions to a MAT file (.mat
) or
function (.m
). It can also create a MATLAB structure or Simulink.Parameter
object from a
Simulink.Bus
object. You can find these actions in the
Share section of the toolstrip.
Open the Type Editor
Simulink® Toolstrip: On the Modeling tab, in the Design gallery, click Type Editor.
MATLAB Command Window: Enter
typeeditor
.Model Explorer: In a bus object dialog box, click Launch Type Editor.
MATLAB Workspace: Double-click a bus object, alias type, or value type.
Examples
Tips
In the Contents pane, display only the columns that are relevant to you. For example, if your focus is simulation, in the Type Editor toolstrip, in the View section, change the column display from
All
toValue
. If your focus is code generation, change the column display toCode
. Alternatively, individually select which table columns appear with the Columns list.A bus object cannot directly or indirectly reference itself. If you define a circular structure, the Type Editor keeps the original data type of the element that would have completed the circle.
When you have a model that creates a bus with a Bus Creator block, you can use the
Simulink.Bus.createObject
function to create the corresponding objects instead of creating eachSimulink.Bus
andSimulink.BusElement
object individually.