QuantityPartition
QuantityPartition[amount,maxAmount]⟹amounts
divides amount into a list of amounts that are all equal to or below the maxAmount.
QuantityPartition[integer,maxInteger]⟹integers
divides integer into a list of integers that are all equal to or below the maxInteger.
Details
-
IncompatibleUnits Some provided quantities are not in compatible units. Please check CompatibleUnitQ on the inputs, and (if provided) the MinPartition option value. MinAboveMax The provided MinPartition option, `1`, exceeds the requested maximum partition size (`2`). Please ensure that the minimum partition size cutoff is below the maximum partiion size.
Input
Output
General Options
Messages
Examples
Basic Examples (3)
Additional Examples (4)
Split a mass for measurement into smaller amounts known to fit in a single weigh boat:
Determine the volumes of samples that will need to be gathered to match a total amount, with a known maximum amount per sample:
An empty list is returned if the amount to partition is below both the max and min partition thresholds:
The function can split Integers without units as well: