QuantityFunction
QuantityFunction[f, inputUnit, outputUnit][input..]⟹output
applies the function f after converting input to inputUnit and returns output in outputUnit.
Details
- Number of 'input' arguments much match length of 'inputUnit' list.
- Evalution procedure is to convert 'input' to 'inputUnit', strip the units off that value, apply 'f' to the resulting numerical values, and finally add 'outputUnit' to the output of the function.
-
InputSizeMismatch Given number of inputs does not match number of function inputs. UnitMismatch Units on given inputs `1` are not compatible with function input units `2`.
Input
Output
Messages
Examples
Basic Examples (3)
Additional Examples (6)
Given numeric inputs, QuantityFunction assumes they are already in the correct unit:
Can give QuantityFunction functions with named variables:
Apply a QuantityFunction to a list of quantities:
Apply a QuantityFunction to a list of numbers:
Apply a QuantityFunction to a QuantityArray:
Apply a QuantityFunction to another QuantityArray: