Main Content

getLeafBusElements

Leaf elements in Simulink.Bus object

Description

getLeafBusElements(busObj) returns the leaf elements in the specified Simulink.Bus object.

A leaf element of a bus object is any element of the bus object that is not defined by another bus object. For example, a signal or message can be a leaf element of a bus object.

example

Examples

collapse all

Any element that is not defined by a bus object is a leaf element. For example, signals can be leaf elements of a bus object.

Load a bus object into the base workspace by running the function named busObjectDefinition.

busObjectDefinition

The top-level bus object, named TopBus, defines a signal named Step and a nested bus object. The nested bus object defines two signals: Chirp and Sine.

Get information about the leaf elements in TopBus.

leaf = getLeafBusElements(TopBus)
leaf = 
  3x1 BusElement array with properties:

    Min
    Max
    DimensionsMode
    Description
    Unit
    Name
    DataType
    Complexity
    Dimensions

Get the properties of a leaf element.

leaf(1)
ans = 
  BusElement with properties:

              Name: 'Chirp'
        Complexity: 'real'
        Dimensions: 1
          DataType: 'double'
               Min: []
               Max: []
    DimensionsMode: 'Fixed'
              Unit: ''
       Description: ''

Input Arguments

collapse all

Bus definition, specified as a Simulink.Bus object. The top-level bus object and each nested bus object must be in the base workspace.

Tips

Use the getLeafBusElements function to determine the data type, complexity, and dimensions of MATLAB® timeseries objects needed to create a structure of timeseries objects from a bus.

Version History

Introduced in R2010b