This is machine translation

Translated by Microsoft
Mouseover text to see original. Click the button below to return to the English version of the page.

Note: This page has been translated by MathWorks. Click here to see
To view all translated materials including this page, select Country from the country navigator on the bottom of this page.

Using Buses with MATLAB System Blocks

This example shows how to use buses as inputs and outputs to the MATLAB System block.

  • The Gain block uses a System object™ that applies the gain specified in the block to the bus elements 'a' and 'b' of the incoming bus. The output of the block is the same bus type as the input.

  • The Math Operations block uses a System object that computes the sum, product, and difference between the two bus elements 'a' and 'b' of the input bus. The output of the block is a bus with three elements: 'sum', 'prod', and 'diff'.

  • Note, if a System block output bus is the same type as the input bus, you must still specify the output bus name in the 'getOutputDataTypeImpl' method. This is because the 'propagatedInputDataType' method does not return the input bus object during bus propagation.

  • Before model initialization, all bus types used as either inputs or outputs to the MATLAB System block must be available in the MATLAB base workspace.