convert/Array
convert an array, Array, vector, Vector, matrix, Matrix, list, or listlist to an Array
Calling Sequence
Parameters
Options
Description
Examples
Compatibility
convert( A, Array, opts )
A
-
array, Array, vector, Vector, matrix, Matrix, list, listlist; expression to convert
opts
(optional) one or more options as described below
copy : truefalse
Indicates whether a new rtable should be allocated when converting from other rtable types such as Matrix or Vector. The default is false, meaning that convert will attempt to provide a reference to the existing rtable instead of allocating a new one.
format : string
The option behaves identically to targetformat, but is only valid when expr is not itself a string or ByteArray.
sourceformat : string
A string corresponding to one of the file formats described in Formats. The input expr will be decoded using the specified format and the data returned as a Array. If the format specified is not one for which an Array is a valid output type, an error is issued.
If the format specified is not one for which an Array is a valid output type and no target format is specified, an error is issued.
targetformat : string
A string corresponding to one of the file formats described in Formats. The input expr will be encoded in the specified format and the encoded data returned as an Array.
Note that this can be used in conjunction with sourceformat to decode data from a source to an arbitrary intermediate expression, then encode it as an Array in a different format.
Any other options specified will be passed to the Array constructor.
The convert(A, Array) function converts A into an Array. This is accomplished by passing A and any additional parameters to the Array constructor. No special order is required for the additional parameters.
A≔1,2,3,4
A1≔convert⁡A,Array
A1≔1234
type⁡A,Array
false
type⁡A1,Array
true
M≔matrix⁡3,3,1,1,1,1,2,3,7,8,9
M≔111123789
M1≔convert⁡M,Array,datatype=float
M1≔1.1.1.1.2.3.7.8.9.
type⁡M,Array
type⁡M1,Array
LL≔1,2,−3,4
LL1≔convert⁡LL,Array,datatype=float,−3..−4,−5..−4,order=C_order
type⁡LL,Array
type⁡LL1,Array
ArrayDims⁡LL1
−3..−4,−5..−4
ArrayOptions⁡LL1
datatype=float8,storage=rectangular,order=C_order
AA≔1,2,−3,4
AA1≔convert⁡AA,Array,datatype=float,band1,1,order=C_order
AA1≔1.2.−3.4.
type⁡AA,Array
type⁡AA1,Array
ArrayDims⁡AA1
1..2,1..2
ArrayOptions⁡AA1
datatype=float8,storage=band1,1,order=C_order
ArrayIndFns⁡AA1
band1,1
convert⁡1,2,3\n4,5,6\n7,8,9,Array,sourceformat=CSV
123456789
The convert/Array command was updated in Maple 2022.
The copy, format, sourceformat and targetformat options were introduced in Maple 2022.
For more information on Maple 2022 changes, see Updates in Maple 2022.
See Also
Array
array(deprecated)
ArrayDims
ArrayIndFns
ArrayOptions
convert/array
convert/Matrix
convert/Vector
Matrix
rtable
type/Array
Download Help Document