万博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 ofcm
to 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:
Clear theAllow automatic unit conversionsconfiguration parameter.
Insert aUnit Conversionblock between the ports whose units you want to convert.
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.
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.
Inport|MATLAB Function|Outport|Signal Specification|Simulink.BusElement
|Simulink.Parameter
|Simulink.Signal
|Unit Conversion|Unit System Configuration