We deliver solutions for the AI eraâcombining symbolic computation, data-driven insights and deep technology expertise.
QuantityArray[mags,unit]
represents an array of quantities with magnitudes mags and common unit.
QuantityArray[mags,{unit1,unit2,…}]
represents an array of lists of quantities with units {unit1,unit2,…}.
DetailsA list of lengths, all given in meters:
Extract its magnitudes and units separately:
A list of pairs {time,length}:
Extract its magnitudes and units separately:
Convert a normal array of quantities into a QuantityArray representation:
Scope (6)Construct an array of quantities with the same unit:
Convert a normal array of quantities with the same unit:
Construct an array of tuples of quantities with different units:
Convert a normal matrix of quantities with the same units in each column:
Construct an array of matrices of quantities with different units:
Convert a normal matrix of quantities with the same units in each subarray:
Construct an array of quantities with IndependentUnit specifications:
Convert an array of Quantity objects into a QuantityArray expression:
QuantityArray objects include properties that give information about the array:
The "Summary" property gives a brief summary of information about the array:
The "StructuredAlgorithms" property gives a list of functions that have algorithms that use the structure of the representation:
The array of magnitudes and the elementary block of units can be extracted using properties:
Properties & Relations (8)A QuantityArray object is interpreted as an array of Quantity objects:
It is a list of pairs; hence, a matrix, not a vector:
It is an array of Quantity objects, not an array of numbers:
The QuantityArray representation is memory efficient:
It uses only 6% of the memory of the corresponding normal representation:
It also allows faster extraction of magnitudes and units:
Compare to the slower extraction from the normal array of quantities:
A single quantity is automatically converted into a Quantity object:
This is a list with one quantity:
During conversion, QuantityArray does not try to change units:
UnitConvert will unify the units:
The QuantityArray structure is preserved in multiple operations. Take two arrays:
Addition of QuantityArray objects of compatible units, automatically converting some of them:
Multiplication of QuantityArray objects of compatible dimensions:
Tensor product of QuantityArray objects:
Transposition is special because it stores the permutation:
Flattening is also special in that sense:
The result is an equivalent representation of the original quantity array:
Take a QuantityArray object with compatible but different units:
CommonUnits will convert it into a single unit array:
To select the unit, use UnitConvert:
A QuantityArray object of infinite precision:
The arithmetic operations take precision into account:
QuantityArray will automatically attempt to interpret an unknown unit string:
Possible Issues (1)Normalization of QuantityArray objects also normalizes purely numerical quantities such as percents:
Specify that only the QuantityArray structure should be normalized:
Wolfram Research (2015), QuantityArray, Wolfram Language function, https://reference.wolfram.com/language/ref/QuantityArray.html (updated 2020). TextWolfram Research (2015), QuantityArray, Wolfram Language function, https://reference.wolfram.com/language/ref/QuantityArray.html (updated 2020).
CMSWolfram Language. 2015. "QuantityArray." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2020. https://reference.wolfram.com/language/ref/QuantityArray.html.
APAWolfram Language. (2015). QuantityArray. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/QuantityArray.html
BibTeX@misc{reference.wolfram_2025_quantityarray, author="Wolfram Research", title="{QuantityArray}", year="2020", howpublished="\url{https://reference.wolfram.com/language/ref/QuantityArray.html}", note=[Accessed: 11-July-2025 ]}
BibLaTeX@online{reference.wolfram_2025_quantityarray, organization={Wolfram Research}, title={QuantityArray}, year={2020}, url={https://reference.wolfram.com/language/ref/QuantityArray.html}, note=[Accessed: 11-July-2025 ]}
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4