WOLFRAM SYSTEM MODELER
inUnitConvert amount-of-quantity to unit |
|
SystemModel["SystemModelerExtras.Experimental.Units.inUnit"]

The call inUnit(u, unit) represents a unit conversion of the value of quantity u to the unit unit. The argument unit must be an evaluable String expression (typically a String literal) with valid unit syntax, and there has to exist a valid conversion from the unit of u to the unit unit.
It is an error if the unit of u cannot be determined. This will be the case when u has undefined unit due to incompleteness of the unit handling system, but can also happen as a result of disabling all or parts of the unit handling system.
In case the conversion would be different depending on whether u is absolute or relative, it is an error if this information cannot be determined. For example, a conversion from "K" to "degC" requires this information.
After model translation, the call inUnit(u, unit) will have been replaced by a concrete arithmetic operation on u.
If the choice of target unit is not important as long as it resolves a unit conflict, use autoUnit instead.
To only get the numerical value of the converted value of quantity, use withoutUnit instead.
y = inUnit(u, unit)
| u |
Type: Real Description: Amount-of-quantity to be converted |
|---|---|
| unit |
Type: String Description: Conversion target unit |
| y |
Type: Real Description: Amount-of-quantity expressed in 'unit' |
|---|