Documentation

Converting Units

万博1manbetx®can convert units between ports when it detects discrepancies that have known mathematical relationships such as:

  • Scaling factors

  • Conversion factors and offsets, such asF(Fahrenheit) toC(Celsius)

  • Scaled, inverse units, such asmpg(miles per gallon) andL/km(liters per kilometer).

For example, if you connect one port with a unit ofcmto one with a unit ofmm, Simulink can automatically scale one unit to work with the other.

To enable Simulink to convert unit mismatches in your model automatically, select theAllow automatic unit conversionsconfiguration parameter.

  • When Simulink successfully converts signal units at a block port, it displays.

  • When Simulink detects that an automatic conversion is not possible, it displays.

手动转换单元由一个conversio分开n factor or offset:

  1. Clear theAllow automatic unit conversionsconfiguration parameter.

  2. Insert aUnit Conversionblock between the ports whose units you want to convert.

Tip

Automatic conversion of units is a convenience. For better control of units, when Simulink detects a mismatch, consider modifying the units specified at one or the other of the two connected ports.

Automatic Unit Conversion Limitations

Simulink does not support automatic conversion:

  • At the boundaries of virtual subsystems. Virtual subsystems have theTreat as atomic unitparameter cleared. For more information, seeNonvirtual and Virtual Blocks.

  • At the root level of models configured for concurrent execution or export-function models. For more information, seeConfigure Your Model for Concurrent ExecutionandExport-Function Models.

  • For fixed-point and integer signals.

  • At an input port of aMergeblock.

  • At any port of an asynchronousRate Transitionblock.

  • At an input port of a function-call subsystem.

  • For bus signals.

See Also

||||||||

Related Examples

More About

Was this topic helpful?