Can I specify the output of the Compare to Constant block to be a data type other than boolean or uint8?

6 views (last 30 days)

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 14 Apr 2011
The ability to specify the output of Compare to Constant and Compare to Zero blocks to be a data type other than boolean or uint8 is not available in Simulink.
To work around this issue, either use the Relational Operator block (which allows any Simulink data type to be specified for its output), or pass the output into a Data Type Conversion block.
Alternatively, the block in the library is a masked subsystem and could easily be modified to provide additional output options by making changes to the mask initialization code. If you maintain your own custom blocks library, the block can be added to the custom library and the relevant changes to handling the output data type can be made to the block in the custom library.

More Answers (0)

Categories

Find more on Custom Libraries in Help Center and File Exchange

Products

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!