fixed-凯发k8网页登录

main content

fixed-point instrumentation and data type override

the conversion of a model from floating point to fixed point requires configuring fixed-point instrumentation and data type overrides. however, leaving these settings on after the conversion can lead to unexpected results.

the fixed-point tool automatically enables fixed-point instrumentation when you click the collect ranges button in the tool. by default, the fixed-point tool uses the current data type override set on the model. you can also choose to override data types with doubles, singles, or scaled doubles. when the simulation or derivation is complete, the tool automatically disables the instrumentation and removes the data type override, if data type override was selected in the tool. when you click the simulate with embedded types button, the tool enables instrumentation during the simulation. data type override settings on the model are not affected.

control instrumentation settings

the fixed-point instrumentation mode controls which objects log minimum, maximum, and overflow data during simulation. instrumentation is required to collect simulation ranges using the fixed-point tool. these ranges are used to propose data types for the model. when you are not actively converting your model to fixed point, disable the fixed-point instrumentation to restore the maximum simulation speed to your model.

to enable instrumentation outside of the fixed-point tool, at the command line set the minmaxoverflowlogging parameter to minmaxandoverflow or overflowonly.

set_param('mymodel','minmaxoverflowlogging','minmaxandoverflow')

instrumentation requires a fixed-point designer™ license. to disable instrumentation on a model, set the parameter to forceoff or uselocalsettings.

set_param('mymodel','minmaxoverflowlogging','uselocalsettings')

control data type override

use data type override to simulate your model using double, single, or scaled double data types. if you do not have fixed-point designer software, you can still configure data type override settings to simulate a model that specifies fixed-point data types. using this setting, the software temporarily overrides data types with floating-point data types during simulation.

set_param('mymodel','datatypeoverride','double')

to observe the true behavior of your model, set the data type override parameter to uselocalsettings or off.

set_param('mymodel','datatypeoverride','off')

instrumentation settings and data type override for a model reference hierarchy

when you simulate a model that contains referenced models, the data type override and fixed-point instrumentation settings for the top-level model do not control the settings for the referenced models. you must specify these settings separately for the referenced model. if the settings are inconsistent, for example, if you set the top-level model data type override setting to double and the referenced model to use local settings and the referenced model uses fixed-point data types, data type propagation issues might occur.

when you change the fixed-point instrumentation and data type override settings for any instance of a referenced model, the settings change on all instances of the model and on the referenced model itself.

data type override limitations

for these blocks, data type override is not supported.

  • stateflow chart blocks that use matlab® as the action language

  • state transition table blocks that use matlab as the action language

  • truth table blocks that use matlab as the action language

  • test sequence block

  • matlab function block

  • matlab discrete-event system block

  • requirements table block

related topics

网站地图