rtable_split_unit - Maple Help

rtable_split_unit

extract data and unit from a Units indexing function of an rtable

 Calling Sequence rtable_split_unit(A)

Parameters

 A - rtable

Description

 • The rtable_split_unit(A) function, where A is an Array, Matrix, or Vector, returns substructures pertaining to the Units indexing function property of A.  If A is an rtable that does not have a Units indexing function, then NULL is returned.
 In the case that A is an Array, this is equivalent to op(1, A).
 You can also use MatrixOptions or VectorOptions with the shape parameter to obtain the indexing functions (shape) for Matrices and Vectors, respectively.

Examples

Create a vector with each entry in meters

 > $M≔\mathrm{Vector}\left(2,i↦i\cdot \mathrm{Unit}\left(m\right),\mathrm{shape}=\mathrm{Unit}\left(m\right)\right)$
 ${M}{≔}\left[\begin{array}{c}⟦{m}⟧\\ {2}{}⟦{m}⟧\end{array}\right]$ (1)

The split data will be the default unit, and the vector data without any units

 > $\mathrm{rtable_split_unit}\left(M\right)$
 $\left[⟦{m}⟧{,}\left[\begin{array}{c}{1}\\ {2}\end{array}\right]\right]$ (2)

After assigning Unit(s) into the second entry, there is no longer a single unit that can apply to every entry in the vector.  The split data will be a vector of units that matches the dimensions such that a complete point is an entry from the unit part times the entry at the same index in the data part.

 > $M\left[2\right]≔3\mathrm{Unit}\left(s\right)$
 ${{M}}_{{2}}{≔}{3}{}⟦{s}⟧$ (3)
 > $\mathrm{rtable_split_unit}\left(M\right)$
 $\left[\left[\begin{array}{c}⟦{m}⟧\\ ⟦{s}⟧\end{array}\right]{,}\left[\begin{array}{c}{1}\\ {3}\end{array}\right]\right]$ (4)

Compatibility

 • The rtable_split_unit command was introduced in Maple 2024.