WOLFRAM SYSTEM MODELER

inUnit

Convert amount-of-quantity to unit

Wolfram Language

In[1]:=
SystemModel["SystemModelerExtras.Experimental.Units.inUnit"]
Out[1]:=

Information

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.

It is an error if it is undefined whether u is absolute or relative, while this information would affect the conversion. For example, a conversion from "K" to "degC" requires this information.

After model translation, the call inUnit(u, unit) will have been replaced a concrete arithmetic operation on u.

To only get the numerical value of the converted value of quantity, use withoutUnit instead.

Syntax

y = inUnit(u, unit)

Inputs (2)

u

Type: Real

Description: Amount-of-quantity to be converted

unit

Type: String

Description: Conversion target unit

Outputs (1)

y

Type: Real

Description: Amount-of-quantity expressed in 'unit'