Convert a Scalar to a Non-Dimensional Value or an Integer

A scalar is a value that may have units attached to it. This can be the output of a block.

There are situations, where you may want to use this scalar value as an input to another block, which accepts a non-dimensional value. 

Fortunately, there are a couple easy ways to remove the units.

Approach 1

In the Properties for the Scalar value, use the "round", "ceiling" or "floor" property (depending on how you want to perform the rounding), which will output an integer. You can then use these "tabs" as an input to your desired block.

Approach 2

Use a Divide block and use the scalar as the Operand A and a unit value with same units as the Scalar as the Operand B. For example, if the Scalar is a volume value, with units of mm^3, then you can use 1 mm^3 as the Operand B so the resultant will be just the number value.

Note that depending on the Scalar, the output of this step could be a real number with decimals. You can convert to an Integer using the "round", "ceiling" or "floor" property as described in Approach 1.


Was this article helpful?