convert/conversion_table - convert a list of units into a conversion table
|
Calling Sequence
|
|
convert([L1, L2], conversion_table, opts)
convert(L, conversion_table, opts)
|
|
Parameters
|
|
L1, L2, L
|
-
|
lists of symbols; unit names or symbols
|
opts
|
-
|
(optional) equation(s) of the form option=value where option is one of energy, filter, order, output, or symbolic; specify options for the conversion
|
|
|
|
|
Description
|
|
•
|
The convert([L1, L2], conversion_table) function creates a table indexed by the cartesian product of the lists L1 and L2 where the entries are the conversion factors from the first index to the second.
|
•
|
The convert(L, conversion_table) function is a short form for convert([L, L], conversion_table).
|
•
|
When a conversion factor cannot be found between two valid units, the entry in the table is FAIL.
|
•
|
You can modify the properties of the conversion by including options opts. The opts argument can contain one or more of the following equations.
|
|
This option is passed as an option to the convert/units routine. If this option is set to true, the conversion can be between energy units, not only units with the same dimension. See Energy Conversions. The default value is false.
|
|
This option is a filter applied to the conversion factors. For example, evaluates all conversion factors to five digit floating-point numbers.
|
|
order =lexorder or a procedure
|
|
This option specifies the order in which names should be listed. The order can be specified by a procedure or be the lexicographical order (see sort). The value of this option determines the output order only for output=grid or columns.
|
|
output = table, grid, columns
|
|
By default, output=table. The output is a table as described above.
|
|
If this option is set to grid, a formatted table is returned with unit names and unit symbols of the list L1 in the first two columns, and unit symbols of the list L2 (where available) in the first row.
|
|
If this option is set to columns, a formatted table is returned. In the first column, the unit names from L1 are listed in order. For each entry in the first column, an entry in the second column appears for each unit in L2 for which a conversion exists along with conversion factor in the third column.
|
|
symbolic = `true` or `false`
|
|
This option is passed to the convert/units function as an option. The default value is false.
|
|
|
Examples
|
|
>
|
|
>
|
|
>
|
|
| (1) |
>
|
|
| (2) |
>
|
|
| (3) |
>
|
|
| (4) |
>
|
|
| (5) |
>
|
|
| (6) |
>
|
|
| (7) |
|
|