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.

Control Data Types with the Data Type Duplicate Block

This example shows how to control data types in your model using the Data Type Duplicate block. In this model, the data type of the Constant block (currently single) drives the data types throughout the model.

The Constant1 block has its Output data type parameter set to Inherit: Inherit via back propagation. Because the Constant1 and Constant blocks are both connected to the Data Type Duplicate block, the Constant1 block can inherit its data type from the Constant block. The Sum block has its Output data type set to Inherit: Same as first input, so it is also able to inherit its data type from the Constant block.

If you change the data type of the Constant block from single to int32, the int32 data type propagates throughout the model.