Array - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


convert/Array

convert an array, Array, vector, Vector, matrix, Matrix, list, or listlist to an Array

 

Calling Sequence

Parameters

Options

Description

Examples

Compatibility

Calling Sequence

convert( A, Array, opts )

Parameters

A

-

array, Array, vector, Vector, matrix, Matrix, list, listlist; expression to convert

opts

-

(optional) one or more options as described below

Options

• 

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.

Description

• 

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.

Examples

A1,2,3,4

A1,2,3,4

(1)

A1convertA,Array

A11234

(2)

typeA,Array

false

(3)

typeA1,Array

true

(4)

Mmatrix3,3,1,1,1,1,2,3,7,8,9

M111123789

(5)

M1convertM,Array,datatype=float

M11.1.1.1.2.3.7.8.9.

(6)

typeM,Array

false

(7)

typeM1,Array

true

(8)

LL1,2,3,4

LL1,2,−3,4

(9)

LL1convertLL,Array,datatype=float,3..4,5..4,order=C_order

typeLL,Array

false

(10)

typeLL1,Array

true

(11)

ArrayDimsLL1

−3..−4,−5..−4

(12)

ArrayOptionsLL1

datatype=float8,storage=rectangular,order=C_order

(13)

AA1,2,3,4

AA1,2,−3,4

(14)

AA1convertAA,Array,datatype=float,band1,1,order=C_order

AA11.2.−3.4.

(15)

typeAA,Array

false

(16)

typeAA1,Array

true

(17)

ArrayDimsAA1

1..2,1..2

(18)

ArrayOptionsAA1

datatype=float8,storage=band1,1,order=C_order

(19)

ArrayIndFnsAA1

band1,1

(20)

convert1,2,3\n4,5,6\n7,8,9,Array,sourceformat=CSV

123456789

(21)

Compatibility

• 

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