Is there a check to guarantee that my block will only be used in models that support floating point math in Simulink 7.3 (R2009a)?

1 view (last 30 days)
I have created a library block that requires floating point support. I do not wish my users to drop the block into a model that may generate non-floating point supported code. Is there a way to ensure this check in Simulink?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 27 Jun 2009
There is no direct check to achieve this functionality in Simulink 7.3 (R2009a).
As a workaround, you may use the block callback and the ERT property 'PurelyIntegerCode'.
Access the InitFcn (or other) block callback by right clicking on the block -> Block Properties -> Callbacks. In here you may use the following code to check for floating point numbers.
myConfigObj = getActiveConfigSet('modelname')
myConfigObj.get_param('PurelyIntegerCode')
%Perform check and any SET_PARAM code based on results above.

More Answers (0)

Categories

Find more on Model Compatibility in Help Center and File Exchange

Products


Release

R2009a

Community Treasure Hunt

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

Start Hunting!